rda 0.1.0 → 0.2.0

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.
data/CHANGELOG.md CHANGED
@@ -1,8 +1,7 @@
1
- TODO
1
+ **0.2.0 (Tue, Oct 9, 2012)**
2
2
 
3
- * Check the permission when setup nginx
4
- * Specify passenger_default_user and passenger_default_group manually
5
- * Specify the hostname of the application
3
+ * Support to specify the environment of the application
4
+ * Support to specify the hostname of the application
6
5
 
7
6
  **0.0.6 (Mon, Jul 2, 2012)**
8
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rda (0.1.0)
4
+ rda (0.2.0)
5
5
  confstruct
6
6
  rails (>= 3.1)
7
7
  thor
@@ -39,7 +39,7 @@ GEM
39
39
  arel (3.0.2)
40
40
  builder (3.0.0)
41
41
  coderay (1.0.7)
42
- confstruct (0.2.3)
42
+ confstruct (0.2.4)
43
43
  diff-lcs (1.1.3)
44
44
  erubis (2.7.0)
45
45
  ffi (1.0.11)
data/README.md CHANGED
@@ -80,7 +80,7 @@ This task removes the .rvmrc from your rails application.
80
80
  #### Setup Nginx
81
81
 
82
82
  ```bash
83
- rda nginx setup
83
+ rda nginx setup --environment production --hostname www.example.com
84
84
 
85
85
  # Or
86
86
  rake rda:nginx:setup
@@ -101,7 +101,7 @@ Rda.configure { nginx_conf_paths ['/path/to/nginx/conf'] }
101
101
  Please make sure that you have the write permission of the directory you choosed, or you can run:
102
102
 
103
103
  ```bash
104
- rvmsudo rda nginx setup
104
+ rvmsudo rda nginx setup --environment production --hostname www.example.com
105
105
 
106
106
  # Or
107
107
  rvmsudo rake rda:nginx:setup
@@ -120,15 +120,15 @@ Finally, You need to start Nginx `/path/to/nginx/sbin/nginx` and then visit http
120
120
  #### Discard Nginx settings
121
121
 
122
122
  ```bash
123
- rda nginx discard # Or
123
+ rda nginx discard --hostname www.example.com # Or
124
124
 
125
125
  rake rda:nginx:discard # Or
126
126
 
127
- sudo rda nginx discard # Or
127
+ sudo rda nginx discard --hostname www.example.com # Or
128
128
 
129
129
  sudo rake rda:nginx:discard # Or
130
130
 
131
- rvmsudo rda nginx discard # Using RVM
131
+ rvmsudo rda nginx discard --hostname www.example.com # Using RVM
132
132
 
133
133
  rvmsudo rake rda:nginx:discard # Using RVM
134
134
  ```
data/bin/rda CHANGED
@@ -16,8 +16,10 @@ class RdaCommand < Thor
16
16
  end
17
17
 
18
18
  desc 'nginx ACTION', 'Manage settings of nginx. Available actions: setup, discard.'
19
+ method_option :environment, aliases: "-e", desc: "Set the environment of the application"
20
+ method_option :hostname, aliases: "-h", desc: "Set the hostname of the application"
19
21
  def nginx(action)
20
- Rda::Nginx.new.send(action.to_sym)
22
+ Rda::Nginx.new.send(action.to_sym, options)
21
23
  end
22
24
 
23
25
  desc 'app ACTION', 'Manage the lifecycle of the application. Available actions: restart.'
data/lib/rda/nginx.rb CHANGED
@@ -7,9 +7,11 @@ module Rda
7
7
  end
8
8
 
9
9
  desc "setup", "Set up your rails application"
10
- def setup
10
+ def setup(options = {})
11
11
  return unless installed?
12
12
 
13
+ @hostname, @environment = options["hostname"], options["environment"]
14
+
13
15
  create_setup_load_paths
14
16
  mkdir_for_sites
15
17
  set_passenger_user_and_group
@@ -24,9 +26,11 @@ module Rda
24
26
  end
25
27
 
26
28
  desc "discard", "Remove the settings of your rails application from nginx"
27
- def discard
29
+ def discard(options = {})
28
30
  return unless installed?
29
31
 
32
+ @hostname = options["hostname"]
33
+
30
34
  %W(enabled available).each do |n|
31
35
  remove_file "#{conf_path}/sites-#{n}/#{hostname}"
32
36
  end
@@ -61,7 +65,7 @@ module Rda
61
65
  end
62
66
 
63
67
  def hostname
64
- "#{Rda::Rails.app_name}.local"
68
+ @hostname || "#{Rda::Rails.app_name}.local"
65
69
  end
66
70
 
67
71
  def available_paths
@@ -2,5 +2,5 @@ server {
2
2
  server_name <%= hostname %>;
3
3
  root <%= "#{::Rails.root}/public" %>;
4
4
  passenger_enabled on;
5
- rails_env development;
5
+ rails_env <%= @environment || "development" %>;
6
6
  }
data/lib/rda/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rda
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-19 00:00:00.000000000 Z
12
+ date: 2012-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  segments:
257
257
  - 0
258
- hash: 1257555642380015887
258
+ hash: 4004764091252748463
259
259
  required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  none: false
261
261
  requirements:
@@ -264,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  segments:
266
266
  - 0
267
- hash: 1257555642380015887
267
+ hash: 4004764091252748463
268
268
  requirements: []
269
269
  rubyforge_project:
270
270
  rubygems_version: 1.8.24