Skip to content

Instantly share code, notes, and snippets.

View deependersingla's full-sized avatar

Deepender Singla deependersingla

View GitHub Profile
Bundler.with_env helpers
Bundler.with_clean_env
should keep the original GEM_PATH even in sub processes
should not pass any bundler environment variables
should not pass RUBYOPT changes
should not change ORIGINAL_ENV
it should behave like Bundler.with_*_env
should reset and restore the environment
Bundler.with_original_env
should pass bundler environment variables set before Bundler was run
bundle install with git sources when specifying local override uses the local repository instead of checking a new one out
Failure/Error: expect(out).to match(/at #{lib_path('local-rack')}/)
expected "Fetching source index from file:/home/deepender/bundler/tmp/gems/remote1/\nResolving dependencies...\nusing 3 already installed gems\nYour bundle is complete!\nUse `bundle show [gemname]` to see where a bundled gem is installed." to match /at \/home\/deepender\/bundler\/tmp\/libs\/local-rack/
Diff:
@@ -1,2 +1,6 @@
-/at \/home\/deepender\/bundler\/tmp\/libs\/local-rack/
+Fetching source index from file:/home/deepender/bundler/tmp/gems/remote1/
+Resolving dependencies...
+using 3 already installed gems
+Your bundle is complete!
deepender@deepender-Vostro-1450:~/niveshi$ dbundle --verbose
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.1.0
Using i18n 0.6.5
Using multi_json 1.8.1
Using activesupport 3.2.12
Using builder 3.0.4
Using activemodel 3.2.12
[3] pry(main)> reload-code self
/home/deepender/pry/lib/pry/core_extensions.rb:7: warning: already initialized constant Pry::BINDING_METHOD_IMPL
/home/deepender/pry/lib/pry/core_extensions.rb:7: warning: previous definition of BINDING_METHOD_IMPL was here
self was reloaded!
[4] pry(main)> reload-code
/home/deepender/pry/lib/pry/core_extensions.rb:7: warning: already initialized constant Pry::BINDING_METHOD_IMPL
/home/deepender/pry/lib/pry/core_extensions.rb:7: warning: previous definition of BINDING_METHOD_IMPL was here
self was reloaded!
it 'should take care of corner cases like mongo[] e.g Foo::Bar.new[]- issue 998' do
klass = Class.new { def []; :hello; end }
meth = Pry::Method.from_str("klass.new[]", Pry.binding_for(binding))
meth.name.should == "[]"
end
[2] pry(main)> f = Foo::Bar.new
=> #<Foo::Bar:0x000000032174a8>
[3] pry(main)> $ f.[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
def [](key)
Test:
[2] pry(main)> f = Foo::Bar.new
=> #<Foo::Bar:0x00000002f105e8>
[3] pry(main)> $ f.[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
pry(main)> f = Foo::Bar.new
=> #<Foo::Bar:0x000000030204d8>
[3] pry(main)> $ f.[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
def [](key)