Skip to content

Commit

Permalink
Merge pull request #12 from ostsjoe/master
Browse files Browse the repository at this point in the history
hubot --create deprecated
  • Loading branch information
spajus committed Apr 18, 2015
2 parents 8de5363 + 0f7591b commit 7b46624
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/status_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def show
@npm = Status.npm
@coffee = Status.coffee
@hubot = Status.hubot
@yo = Status.yo
@hubots_dir = Hubot.base_dir
@scripts_dir = Script.base_dir
@hubots_dir_perms = Status.hubot_dir_writable?
Expand Down
3 changes: 2 additions & 1 deletion app/models/hubot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def cwd

def install
self.location = File.join(Hubot.base_dir, title.parameterize)
log Shell.run("hubot --create #{self.location}")
log Shell.run("mkdir #{self.location}")
log Shell.run("cd #{self.location} && yo hubot --name='#{name}' --adapter=#{adapter} --defaults")
log Shell.run("cd #{self.location} && bin/hubot -v")
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def hubot
@@hubot ||= Shell.run('hubot -v').try(:strip)
end

def yo
@@yo ||= Shell.run('yo --version').try(:strip)
end

def hubot_dir_writable?
begin
FileUtils.mkdir_p(Hubot.base_dir)
Expand Down
5 changes: 5 additions & 0 deletions app/views/status/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<td><%= @hubot || 'Run <code>npm install -g hubot</code> after Node, NPM and CoffeeScript are installed'.html_safe %></td>
<td><%= feedback(@hubot, 'Installed', 'Not Installed') %></td>
</tr>
<tr>
<td>Yo</td>
<td><%= @yo || 'Run <code>npm install -g yo generator-hubot</code> after Hubot, Node, NPM and CoffeeScript are installed'.html_safe %></td>
<td><%= feedback(@yo, 'Installed', 'Not Installed') %></td>
</tr>
<tr>
<td>System user</td>
<td><%= @sys_user %></td>
Expand Down

0 comments on commit 7b46624

Please sign in to comment.