Class: JBundler::Config
- Inherits:
-
Object
- Object
- JBundler::Config
- Defined in:
- lib/jbundler/config.rb
Overview
allow yaml config in $HOME/.jbundlerrc and $PWD/.jbundlerrc
Instance Attribute Summary collapse
-
#gemfile ⇒ Object
Returns the value of attribute gemfile.
-
#jarfile ⇒ Object
Returns the value of attribute jarfile.
-
#local_repository ⇒ Object
Returns the value of attribute local_repository.
-
#offline ⇒ Object
Returns the value of attribute offline.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#skip ⇒ Object
Returns the value of attribute skip.
-
#vendor_dir ⇒ Object
Returns the value of attribute vendor_dir.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#work_dir ⇒ Object
Returns the value of attribute work_dir.
Instance Method Summary collapse
- #classpath_file ⇒ Object
- #gemfile_lock ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #jarfile_lock ⇒ Object
- #mirror ⇒ Object
- #proxy ⇒ Object
- #rubygems_mirror ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
30 31 32 33 34 35 36 37 |
# File 'lib/jbundler/config.rb', line 30 def initialize file = '.jbundlerrc' homefile = File.join(ENV['HOME'], file) home_config = YAML.load_file(homefile) if File.exists?(homefile) pwd_config = YAML.load_file(file) if File.exists?(file) File.( file ) @config = (home_config || {}).merge(pwd_config || {}) end |
Instance Attribute Details
#gemfile ⇒ Object
Returns the value of attribute gemfile.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def gemfile @gemfile end |
#jarfile ⇒ Object
Returns the value of attribute jarfile.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def jarfile @jarfile end |
#local_repository ⇒ Object
Returns the value of attribute local_repository.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def local_repository @local_repository end |
#offline ⇒ Object
Returns the value of attribute offline.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def offline @offline end |
#settings ⇒ Object
Returns the value of attribute settings.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def settings @settings end |
#skip ⇒ Object
Returns the value of attribute skip.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def skip @skip end |
#vendor_dir ⇒ Object
Returns the value of attribute vendor_dir.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def vendor_dir @vendor_dir end |
#verbose ⇒ Object
Returns the value of attribute verbose.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def verbose @verbose end |
#work_dir ⇒ Object
Returns the value of attribute work_dir.
28 29 30 |
# File 'lib/jbundler/config.rb', line 28 def work_dir @work_dir end |
Instance Method Details
#classpath_file ⇒ Object
85 86 87 |
# File 'lib/jbundler/config.rb', line 85 def classpath_file jbundler_env('JBUNDLE_CLASSPATH_FILE') || '.jbundler/classpath.rb' end |
#gemfile_lock ⇒ Object
81 82 83 |
# File 'lib/jbundler/config.rb', line 81 def gemfile_lock "#{gemfile}.lock" end |
#jarfile_lock ⇒ Object
73 74 75 |
# File 'lib/jbundler/config.rb', line 73 def jarfile_lock "#{jarfile}.lock" end |
#mirror ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/jbundler/config.rb', line 111 def mirror @mirror ||= jbundler_env('JBUNDLE_MIRROR') # nice to have no leading slash @mirror = @mirror.sub( /\/$/, '' ) if @mirror if @mirror warn 'mirror config is deprecated, use settings.xml instead' end @mirror end |
#proxy ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/jbundler/config.rb', line 103 def proxy @proxy ||= jbundler_env('JBUNDLE_PROXY') if @proxy warn 'proxy config is deprecated, use settings.xml instead' end @proxy end |
#rubygems_mirror ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/jbundler/config.rb', line 121 def rubygems_mirror @rubygems_mirror ||= jbundler_env('BUNDLE_RUBYGEMS_MIRROR') # here a leading slash is needed !! @rubygems_mirror = @rubygems_mirror.sub( /([^\/])$/ , "\\1/" ) if @rubygems_mirror warn 'reubygems mirror config is deprecated, use bundler >=1.5 and its mirror config' @rubygems_mirror end |