Class: Codenize::Client
- Inherits:
-
Object
- Object
- Codenize::Client
- Defined in:
- lib/codenize/client.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Method Details
#generate ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/codenize/client.rb', line 7 def generate FileUtils.chdir(@options[:dir]) do name = @options[:name] if File.exist?(name) raise "directory already exists: #{name}" end Bundler.with_clean_env do sh 'bundle', 'gem', name or raise 'bundle gem faild' end FileUtils.chdir(name) do update_files(name) create_files(name) @logger.info 'Adding generated code to git repo' sh 'git', 'add', '.' end end end |