Class: WatirInstall::Generators::New
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- WatirInstall::Generators::New
- Includes:
- Thor::Actions
- Defined in:
- lib/watir_install/generators/new.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bundle ⇒ Object
- #data_files ⇒ Object
- #initial_commit ⇒ Object
- #page_files ⇒ Object
- #root_files ⇒ Object
- #support_files ⇒ Object
- #test_files ⇒ Object
- #user_email ⇒ Object
- #user_name ⇒ Object
Class Method Details
.source_root ⇒ Object
14 15 16 |
# File 'lib/watir_install/generators/new.rb', line 14 def self.source_root "#{File.dirname(__FILE__)}/new" end |
Instance Method Details
#bundle ⇒ Object
64 65 66 67 |
# File 'lib/watir_install/generators/new.rb', line 64 def bundle Dir.chdir(name) system 'bundle install' end |
#data_files ⇒ Object
51 52 53 |
# File 'lib/watir_install/generators/new.rb', line 51 def data_files template "spec/support/data/base.rb.tt", "#{name}/spec/support/data/base.rb" end |
#initial_commit ⇒ Object
69 70 71 72 73 74 |
# File 'lib/watir_install/generators/new.rb', line 69 def initial_commit if no_git == 'false' @git.lib.add('.', all: true) @git.commit("initial commit", {all: true}) end end |
#page_files ⇒ Object
55 56 57 |
# File 'lib/watir_install/generators/new.rb', line 55 def page_files template "spec/support/pages/base.rb.tt", "#{name}/spec/support/pages/base.rb" end |
#root_files ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/watir_install/generators/new.rb', line 37 def root_files template "gemfile.rb.tt", "#{name}/Gemfile" template "gitignore.rb.tt", "#{name}/.gitignore" template "rakefile.rb.tt", "#{name}/Rakefile" template "readme.rb.tt", "#{name}/README.md" template "ruby-version.rb.tt", "#{name}/.ruby-version" template "travis.rb.tt", "#{name}/.travis.yml" template "rspec.rb.tt", "#{name}/.rspec" end |
#support_files ⇒ Object
59 60 61 62 |
# File 'lib/watir_install/generators/new.rb', line 59 def support_files template "spec/support/sauce_helpers.rb.tt", "#{name}/spec/support/sauce_helpers.rb" template "spec/support/site.rb.tt", "#{name}/spec/support/site.rb" end |
#test_files ⇒ Object
47 48 49 |
# File 'lib/watir_install/generators/new.rb', line 47 def test_files template "spec/spec_helper.rb.tt", "#{name}/spec/spec_helper.rb" end |
#user_email ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/watir_install/generators/new.rb', line 28 def user_email if no_git == 'false' @user_email ||= @git.config["user.email"] @user_email ||= ask "Enter your Email: " @git.config('user.email', @user_email) @user_email end end |
#user_name ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/watir_install/generators/new.rb', line 18 def user_name if no_git == 'false' @git = Git.init(name) @user_name ||= @git.config["user.name"] @user_name ||= ask "Enter your Name: " @git.config('user.name', @user_name) @user_name end end |