plur 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +52 -8
- data/images/slank-plur.jpg +0 -0
- data/lib/plur/capistrano.rb +5 -1
- data/lib/plur/capistrano/figaro.rb +8 -2
- data/lib/plur/capistrano/foreman.rb +5 -3
- data/lib/plur/capistrano/local.rb +0 -1
- data/lib/plur/capistrano/upstart.rb +4 -2
- data/lib/plur/version.rb +1 -1
- data/plur.gemspec +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21421aaad32806bb70c97178a8bef8a7583abbf
|
4
|
+
data.tar.gz: 8dc3966101c5b26fc1a22f94a6bdad89bcca45b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9661c9a16374d3416986878d40571fd076507b1356ba59cc7bffb77150d37fcda1c4f98142a60daaaf88720d63f2299eb90380186935c6ac5696f57cdd3d180c
|
7
|
+
data.tar.gz: 5cd184a1a28284a8fd46c16c7d79656664f4dbd7e5e8677b84ade502cd38413385189de0a6277720e18dba18ec60c367edd53df161f73db92bbba960487fed3b
|
data/README.markdown
CHANGED
@@ -1,24 +1,67 @@
|
|
1
1
|
# Plur
|
2
2
|
|
3
|
-
|
3
|
+
Opinionated development workflow and commonly used tools for Ruby on Rails based development.
|
4
|
+
|
5
|
+
![Logo](https://raw.github.com/subosito/plur/master/images/slank-plur.jpg)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
|
9
|
+
As usual, add the Plur into your Gemfile:
|
8
10
|
|
9
11
|
gem 'plur'
|
10
12
|
|
11
|
-
|
13
|
+
## Usage
|
12
14
|
|
13
|
-
|
15
|
+
Currently there are two parts on Plur, deployment and helper:
|
14
16
|
|
15
|
-
|
17
|
+
### Deployment
|
16
18
|
|
17
|
-
|
19
|
+
If you're using [Capistrano](https://github.com/capistrano/capistrano), [Figaro](https://github.com/laserlemon/figaro), [Foreman](https://github.com/ddollar/foreman), and deploy it into Ubuntu box or any OS that use [Upstart](http://upstart.ubuntu.com), then you're on right track :)
|
18
20
|
|
19
|
-
|
21
|
+
# deploy.rb
|
22
|
+
require 'plur/capistrano'
|
23
|
+
|
24
|
+
#
|
25
|
+
## Below is the default value, I mean you don't need write these, except you are differ.
|
26
|
+
#
|
27
|
+
|
28
|
+
# foreman
|
29
|
+
set :foreman_format, "upstart"
|
30
|
+
set :foreman_location, "/etc/init"
|
31
|
+
set :foreman_procfile, "Procfile"
|
32
|
+
set :foreman_root, release_path
|
33
|
+
set :foreman_port, 5000
|
34
|
+
set :foreman_app, application
|
35
|
+
set :foreman_user, user
|
36
|
+
set :foreman_log, 'shared_path/log'
|
37
|
+
set :foreman_concurrency, false
|
38
|
+
|
39
|
+
# figaro
|
40
|
+
set :figaro_yaml, true
|
41
|
+
set :figaro_symlink, true
|
42
|
+
set :figaro_output, 'shared_path/application.yml'
|
43
|
+
set :figaro_config, 'latest_release/config/application.yml'
|
20
44
|
|
21
|
-
|
45
|
+
# upstart
|
46
|
+
set :service_name, application
|
47
|
+
|
48
|
+
If you like to locally precompile assets to reduce load on server, you can add:
|
49
|
+
|
50
|
+
# deploy.rb
|
51
|
+
require 'plur/capistrano/local'
|
52
|
+
|
53
|
+
### Helpers
|
54
|
+
|
55
|
+
By default Plur will install several helpers, see [view.rb](https://github.com/subosito/plur/blob/master/lib/plur/helpers/view.rb):
|
56
|
+
|
57
|
+
- current_locale
|
58
|
+
- rtl_locales
|
59
|
+
- rtl?
|
60
|
+
- orientation
|
61
|
+
- notifications
|
62
|
+
- namespace_name
|
63
|
+
- body_attributes
|
64
|
+
- build_html
|
22
65
|
|
23
66
|
## Contributing
|
24
67
|
|
@@ -27,3 +70,4 @@ TODO: Write usage instructions here
|
|
27
70
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
71
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
72
|
5. Create new Pull Request
|
73
|
+
|
Binary file
|
data/lib/plur/capistrano.rb
CHANGED
@@ -18,11 +18,17 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
18
18
|
transfer :up, figaro_tmpfile, figaro_output, via: :scp
|
19
19
|
run_locally "rm #{figaro_tmpfile}"
|
20
20
|
end
|
21
|
+
|
22
|
+
task :config_symlink, roles: :app do
|
23
|
+
run "ln -sf #{figaro_output} #{figaro_config}"
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
|
-
after 'deploy:setup'
|
27
|
+
after 'deploy:setup' do
|
28
|
+
figaro.config if plur_callback
|
29
|
+
end
|
24
30
|
|
25
31
|
after 'deploy:finalize_update' do
|
26
|
-
|
32
|
+
figaro.config_symlink if plur_callback and figaro_symlink
|
27
33
|
end
|
28
34
|
end
|
@@ -18,7 +18,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
18
18
|
task :export, roles: :app do
|
19
19
|
bundle_cmd = fetch(:bundle_cmd, "bundle")
|
20
20
|
foreman_format = fetch(:foreman_format, "upstart")
|
21
|
-
foreman_location = fetch(:foreman_location, "/etc/init
|
21
|
+
foreman_location = fetch(:foreman_location, "/etc/init")
|
22
22
|
foreman_procfile = fetch(:foreman_procfile, "Procfile")
|
23
23
|
foreman_port = fetch(:foreman_port, 5000)
|
24
24
|
foreman_root = fetch(:foreman_root, current_path)
|
@@ -35,9 +35,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
35
35
|
args << "-u #{foreman_user}"
|
36
36
|
args << "-l #{foreman_log}"
|
37
37
|
args << "-c #{foreman_concurrency}" if foreman_concurrency
|
38
|
-
run "cd #{release_path} && #{bundle_cmd} exec foreman export #{args.join(' ')}"
|
38
|
+
run "cd #{release_path} && #{sudo} #{bundle_cmd} exec foreman export #{args.join(' ')}"
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
after 'deploy:update'
|
42
|
+
after 'deploy:update' do
|
43
|
+
foreman.export if plur_callback
|
44
|
+
end
|
43
45
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
2
2
|
namespace :upstart do
|
3
|
-
_cset(:service_name) {
|
3
|
+
_cset(:service_name) { application }
|
4
4
|
|
5
5
|
desc "Start the application services"
|
6
6
|
task :start, roles: :app do
|
@@ -18,5 +18,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
after 'deploy:restart'
|
21
|
+
after 'deploy:restart' do
|
22
|
+
upstart.restart if plur_callback
|
23
|
+
end
|
22
24
|
end
|
data/lib/plur/version.rb
CHANGED
data/plur.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = Plur::VERSION
|
9
9
|
gem.authors = ["Alif Rachmawadi"]
|
10
10
|
gem.email = ["subosito@gmail.com"]
|
11
|
-
gem.description = %q{
|
11
|
+
gem.description = %q{Opinionated development workflow and commonly used tools for Ruby on Rails based development.}
|
12
12
|
gem.summary = gem.description
|
13
13
|
gem.homepage = "https://github.com/subosito/plur"
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alif Rachmawadi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-02-
|
11
|
+
date: 2013-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mab
|
@@ -24,7 +24,8 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.2
|
27
|
-
description:
|
27
|
+
description: Opinionated development workflow and commonly used tools for Ruby on
|
28
|
+
Rails based development.
|
28
29
|
email:
|
29
30
|
- subosito@gmail.com
|
30
31
|
executables: []
|
@@ -36,6 +37,7 @@ files:
|
|
36
37
|
- LICENSE.txt
|
37
38
|
- README.markdown
|
38
39
|
- Rakefile
|
40
|
+
- images/slank-plur.jpg
|
39
41
|
- lib/plur.rb
|
40
42
|
- lib/plur/capistrano.rb
|
41
43
|
- lib/plur/capistrano/figaro.rb
|
@@ -68,5 +70,6 @@ rubyforge_project:
|
|
68
70
|
rubygems_version: 2.0.0
|
69
71
|
signing_key:
|
70
72
|
specification_version: 4
|
71
|
-
summary:
|
73
|
+
summary: Opinionated development workflow and commonly used tools for Ruby on Rails
|
74
|
+
based development.
|
72
75
|
test_files: []
|