towsta 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/bin/towsta CHANGED
@@ -2,6 +2,7 @@
2
2
  require 'net/http'
3
3
  action = ARGV.first
4
4
  if action == 'new'
5
+ puts "Generating and configuring your app, it may take a while..."
5
6
  project = ARGV[1]
6
7
  Dir.mkdir project
7
8
  configru = "require './app'\n"
@@ -65,18 +66,36 @@ if action == 'new'
65
66
  Net::HTTP.start("code.jquery.com"){|http| @jquery = http.get('/jquery.min.js').body}
66
67
  File.open("#{project}/public/js/jquery.js", 'w') {|f| f.write(@jquery)}
67
68
  Dir.mkdir "#{project}/public/images"
69
+ Dir.mkdir "#{project}/locales"
68
70
  git = '*.swp'
69
71
  File.open("#{project}/.gitignore", 'w') {|f| f.write(git)}
72
+ s = "cd #{project}"
73
+ system "cd #{project} && git init >/dev/null"
74
+ system "cd #{project} && heroku create >/dev/null" unless system "cd #{project} && heroku create #{project} >/dev/null"
75
+ system "cd #{project} && heroku addons:add sendgrid:starter >/dev/null"
76
+ system "cd #{project} && heroku addons:add memcache >/dev/null"
77
+ system "cd #{project} && heroku addons:add custom_domains:basic >/dev/null"
78
+ system "cd #{project} && heroku addons:add zerigo_dns:basic >/dev/null"
79
+ system "cd #{project} && bundle install >/dev/null"
80
+ system "cd #{project} && towsta deploy >/dev/null"
70
81
  puts "#{project} is ready to towst!"
71
82
  elsif action == 'server'
72
83
  port = ARGV[1].nil? ? '6937' : ARGV[1]
73
84
  system "shotgun -I config.ru -p #{port}"
74
85
  elsif action == 'console'
75
86
  system 'irb -r ./app.rb'
87
+ elsif action == 'deploy'
88
+ system 'git add . >/dev/null'
89
+ message = ARGV[1].nil? ? 'Deployed via Towsta gem' : ARGV[1]
90
+ system "git commit -a -m '#{message}' >/dev/null"
91
+ system 'git push -q >/dev/null' unless system 'git push heroku master -q >/dev/null'
92
+ system 'clear'
93
+ puts 'Deploy is complete!'
76
94
  elsif action == 'help'
77
95
  puts 'towsta new {projectname} {optional: secret} to generate a new project'
78
96
  puts 'towsta server {optional: port} to run the application server'
79
97
  puts 'towsta console to run the application console'
98
+ puts 'towsta deploy {optional: message} to deploy your application'
80
99
  else
81
100
  puts 'Comand not found, try running "towsta help"'
82
101
  end
@@ -1,3 +1,3 @@
1
1
  module Towsta
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
@@ -18,7 +18,7 @@ module Towsta
18
18
  include R18n::Helpers
19
19
 
20
20
  def i18n attr
21
- self.send eval("t.models.#{self.class.to_s.downcase}.#{attr.to_s}").to_sym
21
+ self.send (t[:models][self.class.to_s.downcase.to_sym][attr] || "#{attr.to_s}_#{t.code}").to_sym
22
22
  end
23
23
 
24
24
  def to_mail
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 6
9
- version: 1.2.6
8
+ - 7
9
+ version: 1.2.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mortaro
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-12-13 00:00:00 -02:00
17
+ date: 2012-01-06 00:00:00 -02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency