Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bom
Browse files Browse the repository at this point in the history
* origin/master:
  Fix rubocop offenses
  Added jruby-head
  don't assume `ruby`
  • Loading branch information
bkeepers committed Nov 30, 2015
2 parents 8cfe23b + 648d1bc commit 4d32245
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.rbc
.bundle
.config
.ruby-version
.yardoc
Gemfile.lock
tmp
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rvm:
- 1.9.3
- rbx-2
- jruby-19mode
- jruby-head

sudo: false

Expand Down
6 changes: 3 additions & 3 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ guard "bundler" do
end

guard "rspec", :cmd => "bundle exec rspec" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^spec/spec_helper.rb$}) { "spec" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(/^spec\/.+_spec\.rb$/)
watch(/^spec\/spec_helper.rb$/) { "spec" }
watch(/^lib\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
end
2 changes: 1 addition & 1 deletion dotenv.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new "dotenv", Dotenv::VERSION do |gem|

gem.files = `git ls-files README.md LICENSE lib bin | grep -v rails`
.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.executables = gem.files.grep(/^bin\//).map { |f| File.basename(f) }

gem.add_development_dependency "rake"
gem.add_development_dependency "rspec"
Expand Down
10 changes: 5 additions & 5 deletions spec/dotenv/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ def env(string)

if RUBY_VERSION > "1.8.7"
it "parses shell commands interpolated in $()" do
expect(env("ruby_v=$(ruby -v)")).to eql("ruby_v" => RUBY_DESCRIPTION)
expect(env("echo=$(echo hello)")).to eql("echo" => "hello")
end

it "allows balanced parentheses within interpolated shell commands" do
expect(env('ruby_v=$(echo "$(echo "$(echo "$(ruby -v)")")")'))
.to eql("ruby_v" => RUBY_DESCRIPTION)
expect(env('echo=$(echo "$(echo "$(echo "$(echo hello)")")")'))
.to eql("echo" => "hello")
end

it "doesn't interpolate shell commands when escape says not to" do
expect(env('ruby_v=escaped-\$(ruby -v)'))
.to eql("ruby_v" => "escaped-$(ruby -v)")
expect(env('echo=escaped-\$(echo hello)'))
.to eql("echo" => "escaped-$(echo hello)")
end

it "is not thrown off by quotes in interpolated shell commands" do
Expand Down

0 comments on commit 4d32245

Please sign in to comment.