Class: Raykit::Project
- Inherits:
-
Object
- Object
- Raykit::Project
- Defined in:
- lib/raykit/project.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #commit ⇒ Object
- #directory ⇒ Object
-
#initialize ⇒ Project
constructor
A new instance of Project.
- #pull ⇒ Object
- #push ⇒ Object
- #tag ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize ⇒ Project
Returns a new instance of Project.
10 11 12 13 14 |
# File 'lib/raykit/project.rb', line 10 def initialize() @name=NAME if(defined?(NAME)) @directory=RAKE_DIRECTORY @version=Raykit::Version.detect end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/raykit/project.rb', line 6 def name @name end |
Instance Method Details
#commit ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/raykit/project.rb', line 24 def commit Dir.chdir(@directory) do if(File.exist?('.gitignore')) Raykit::run("git add --all") if(GIT_DIRECTORY.outstanding_commit?) Raykit::run("git commit -m'update'") Raykit::run("git push") end else puts "warning: .gitignore not found." end end end |
#directory ⇒ Object
16 17 18 |
# File 'lib/raykit/project.rb', line 16 def directory @directory end |
#pull ⇒ Object
45 46 47 48 49 |
# File 'lib/raykit/project.rb', line 45 def pull Dir.chdir(@directory) do Raykit::run('git pull') end end |
#push ⇒ Object
38 39 40 41 42 43 |
# File 'lib/raykit/project.rb', line 38 def push Dir.chdir(@directory) do Raykit::run('git push') Raykit::run('git push --tags') end end |
#tag ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/raykit/project.rb', line 51 def tag Dir.chdir(@directory) do tag = `git describe --abbrev=0 --tags`.strip if(@version != tag) Raykit::run('git add --all') Raykit::run("git tag #{@version} -m'#{@version}'") Raykit::run('git push') Raykit::run("git push --tags") end end end |
#version ⇒ Object
20 21 22 |
# File 'lib/raykit/project.rb', line 20 def version @version end |