Module: Onotole::Git
- Included in:
- AppBuilder
- Defined in:
- lib/onotole/git.rb
Instance Method Summary collapse
- #create_github_repo(repo_name) ⇒ Object
- #git_init_commit ⇒ Object
- #gitignore_files ⇒ Object
- #init_git ⇒ Object
- #install_user_gems_from_github ⇒ Object
Instance Method Details
#create_github_repo(repo_name) ⇒ Object
11 12 13 |
# File 'lib/onotole/git.rb', line 11 def create_github_repo(repo_name) system "hub create #{repo_name}" end |
#git_init_commit ⇒ Object
19 20 21 22 23 24 |
# File 'lib/onotole/git.rb', line 19 def git_init_commit return unless user_choose?(:gitcommit) say 'Init commit' run 'git add .' run 'git commit -m "Init commit"' end |
#gitignore_files ⇒ Object
26 27 28 29 |
# File 'lib/onotole/git.rb', line 26 def gitignore_files remove_file '.gitignore' copy_file 'gitignore_file', '.gitignore' end |
#init_git ⇒ Object
15 16 17 |
# File 'lib/onotole/git.rb', line 15 def init_git run 'git init' end |
#install_user_gems_from_github ⇒ Object
4 5 6 7 8 9 |
# File 'lib/onotole/git.rb', line 4 def install_user_gems_from_github File.readlines('Gemfile').each do |l| possible_gem_name = l.match(%r{(?:github:\s+)(?:'|")\w+/(.*)(?:'|")}i) install_from_github possible_gem_name[1] if possible_gem_name end end |