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
- #info ⇒ 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
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/raykit/project.rb', line 31 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 self end |
#directory ⇒ Object
16 17 18 |
# File 'lib/raykit/project.rb', line 16 def directory @directory end |
#info ⇒ Object
24 25 26 27 28 29 |
# File 'lib/raykit/project.rb', line 24 def info puts "Raykit::Environment.root_dir=#{Raykit::Environment.root_dir}" puts "Raykit::Environment.home_dir=#{Raykit::Environment.home_dir}" puts "PROJECT.name=#{PROJECT.name}" puts "PROJECT.version=#{PROJECT.version}" end |
#pull ⇒ Object
54 55 56 57 58 59 |
# File 'lib/raykit/project.rb', line 54 def pull Dir.chdir(@directory) do Raykit::run('git pull') end self end |
#push ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/raykit/project.rb', line 46 def push Dir.chdir(@directory) do Raykit::run('git push') Raykit::run('git push --tags') end self end |
#tag ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/raykit/project.rb', line 61 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 self end |
#version ⇒ Object
20 21 22 |
# File 'lib/raykit/project.rb', line 20 def version @version end |