Class: Pumper::Project
- Inherits:
-
Struct
- Object
- Struct
- Pumper::Project
- Defined in:
- lib/pumper/project.rb
Defined Under Namespace
Classes: UndefinedGem
Instance Attribute Summary collapse
-
#gemset ⇒ Object
Returns the value of attribute gemset.
-
#is_absolute_path ⇒ Object
Returns the value of attribute is_absolute_path.
-
#is_vendor ⇒ Object
Returns the value of attribute is_vendor.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
- #bump_version!(specification) ⇒ Object
-
#initialize(options) ⇒ Project
constructor
A new instance of Project.
- #path ⇒ Object
Constructor Details
#initialize(options) ⇒ Project
Returns a new instance of Project.
5 6 7 8 |
# File 'lib/pumper/project.rb', line 5 def initialize() () @gemfile = gemfile_path end |
Instance Attribute Details
#gemset ⇒ Object
Returns the value of attribute gemset
2 3 4 |
# File 'lib/pumper/project.rb', line 2 def gemset @gemset end |
#is_absolute_path ⇒ Object
Returns the value of attribute is_absolute_path
2 3 4 |
# File 'lib/pumper/project.rb', line 2 def is_absolute_path @is_absolute_path end |
#is_vendor ⇒ Object
Returns the value of attribute is_vendor
2 3 4 |
# File 'lib/pumper/project.rb', line 2 def is_vendor @is_vendor end |
#project ⇒ Object
Returns the value of attribute project
2 3 4 |
# File 'lib/pumper/project.rb', line 2 def project @project end |
Instance Method Details
#bump_version!(specification) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pumper/project.rb', line 10 def bump_version!(specification) text = File.read(@gemfile) if gem_defined?(text, specification.name) File.open(@gemfile, 'w') do |file| file.puts(text.gsub(/#{ gem_name(specification.name) }.*/, specification.for_gemfile)) end else raise Project::UndefinedGem end end |
#path ⇒ Object
21 22 23 24 25 |
# File 'lib/pumper/project.rb', line 21 def path is_absolute_path ? project : File.join(Dir.pwd, "../#{ project }") end |