zwr 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 398179725f92cb0c0ce5afc8f067bef68ed3d39d
4
- data.tar.gz: d226f243e785a7f906c98f6f5f924a91121a08e8
3
+ metadata.gz: 5647a916fa9019f6e1b66b76faa2b0b630e84534
4
+ data.tar.gz: 2fef4a6528ab6d8aae2948d6d135fa2d3024aad6
5
5
  SHA512:
6
- metadata.gz: 0f2fc81920c996f4a48f57cef4cac72280fba64c9d6d672aabcfe5d1bb959fa97f20a714b39c1cf3ba7e6ed49cc809da453bbf6f960adedec99cf648cf5b7911
7
- data.tar.gz: b7266d2e3efe33c699b25be1f36f97d28e2e1e7f68607de869949d4ac5fd87cbcb71c4cdd8f02a3100d32672a804475ab62d604a0e5d592326b6fd764d56d768
6
+ metadata.gz: 779744f7ca42cc34d3c808a6b71b4faf92ec7312a46e4dfcaf535082d69421d291dc18afcce7bef127f01b39e077ec8e22d4099a7a349bf3d9cc487a07d42cdc
7
+ data.tar.gz: 2ad03b49b4f425b209a9c0fdb163b918aab4d513a9373393b2ab22d7d54fdf8bc6f74a6a672f27d481c1ec89912cb2f2e5a1fa2ee3112ea9046c2f0f7461a80c
data/bin/zwr CHANGED
@@ -97,11 +97,9 @@ when 'deploy'
97
97
  puts "This script must be run as super user. Use sudo zwr deploy #{ARGV[2]}"
98
98
  else
99
99
  if File.directory? "/var/rails_apps/#{ARGV[1]}"
100
- putsv "Updating existing #{ARGV[1]}"
101
- Dir.chdir "/var/rails_apps/#{ARGV[1]}"
102
- `cd /var/rails_apps/#{ARGV[1]} ; git fetch`
103
- `cd /var/rails_apps/#{ARGV[1]} ; git checkout production`
104
- `cd /var/rails_apps/#{ARGV[1]} ; git reset --hard origin/production`
100
+ puts "Project is already deployed, do the following:"
101
+ puts "cd /var/rails_apps/#{ARGV[1]}"
102
+ puts "rake zwr:production:update"
105
103
  else
106
104
  Dir.chdir "/var/rails_apps"
107
105
  putsv "Deploying new project #{ARGV[1]}"
@@ -130,8 +128,8 @@ when 'deploy'
130
128
  VHFILE
131
129
  `echo "#{virtual_host_file}" > /etc/httpd/virtual_hosts/#{ARGV[1]}.conf`
132
130
  `service httpd reload`
131
+ `touch /var/rails_apps/#{ARGV[1]}/tmp/restart.txt`
133
132
  end
134
- `touch /var/rails_apps/#{ARGV[1]}/tmp/restart.txt`
135
133
  end
136
134
  else
137
135
  show_usage
@@ -13,6 +13,18 @@ namespace :zwr do
13
13
  `sed "s/# gem 'theruby/gem 'theruby/" -i Gemfile`
14
14
  end
15
15
 
16
+ namespace :production do
17
+ desc "updates production environment to latest production branch"
18
+ task :update do
19
+ `git fetch`
20
+ `git checkout production -q`
21
+ `git reset --hard origin/production`
22
+ `touch tmp/restart`
23
+ puts "now with the latest code from origin/production."
24
+ puts "server restarted."
25
+ end
26
+ end
27
+
16
28
  desc "prepares production branch ready to roll"
17
29
  task :prepare do
18
30
  Dir.chdir Rails.root
@@ -43,6 +55,7 @@ namespace :zwr do
43
55
  `git commit -asm "precompiled resources"`
44
56
  `git push -u origin master`
45
57
  `git push -uf origin production`
58
+ `git checkout master`
46
59
  end
47
60
  end
48
61
  end
@@ -72,7 +72,7 @@ if use_devise
72
72
  inject_into_file 'app/models/user.rb', <<-FILE.strip_heredoc, before: "## Database authenticatable\n"
73
73
  ## ZWR generated fields
74
74
  field :name, type: String, default: ""
75
- field :admin, type: Boolean, default: ""
75
+ field :admin, type: Boolean, default: false
76
76
 
77
77
  FILE
78
78
  gsub_file 'app/models/user.rb', "## Database authenticatable", " ## Database authenticatable"
@@ -83,7 +83,7 @@ if use_devise
83
83
  puts " \033[35mfound\033[0m #{filename}"
84
84
  inject_into_file(filename, <<-FILE, :after => "Database authenticatable\n")
85
85
  t.string :name
86
- t.boolean :admin
86
+ t.boolean :admin, default: false
87
87
  FILE
88
88
  gsub_file "test/test_helper.rb","fixtures :all", "include FactoryGirl::Syntax::Methods"
89
89
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'zwr'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.date = '2014-11-17'
5
5
  s.summary = "All the Zwr needs"
6
6
  s.description = "A gem in which I jam what I commonly use."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zwr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko