plur 0.0.4 → 0.1.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.
- checksums.yaml +13 -5
- data/{LICENSE.txt → LICENSE} +2 -2
- data/README.md +33 -0
- data/lib/plur/version.rb +1 -1
- metadata +8 -12
- data/README.markdown +0 -73
- data/lib/plur/capistrano.rb +0 -8
- data/lib/plur/capistrano/figaro.rb +0 -34
- data/lib/plur/capistrano/foreman.rb +0 -45
- data/lib/plur/capistrano/local.rb +0 -20
- data/lib/plur/capistrano/upstart.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjYzM2FhZTI1NzQwNjFlNzBkNTNmNWY1ZGVjYWVjNThiYmQ2ODY1NQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTljZDA1YzJiZmM0MmY2NWIyMDNjMzE3MDUxYzYxNTNkMzljMTgyYw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZGNkZjQyYzkxZmM1ZDkzYzAzODE4ZmFlYzU1MDAzNTg0OTkzYjJiN2VjZGM2
|
10
|
+
NzJkNzE0ZGFhMDNjNzU5NmFmMDUxN2NjZDM2MDdmMzkxMTRjYWI3MTdkNjRk
|
11
|
+
MGYzYjYwYTg5Y2M4MTA0ZDhjOWU4ZjVhZTkzYzRiOTNhMjIzMmU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NTQ4OWFlNDY3MjJiYzJlMGQ3MmJkYmI2ZDkyYmY3Mjc1M2JkM2QyZTFkNGE0
|
14
|
+
Nzk2OTRhMTAzNjlhYjQ3M2ViNjMxZjk5OTc3ZGMwOGMxZDY5NmE0MWQzYjY4
|
15
|
+
ZDBjOGNlNDU4ODAwMjk0MTE1NzZiZGIwMmIyNzgyNDU3OGRhYmQ=
|
data/{LICENSE.txt → LICENSE}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2013 Alif Rachmawadi
|
1
|
+
Copyright (c) 2013 Alif Rachmawadi <subosito@gmail.com>
|
2
2
|
|
3
3
|
MIT License
|
4
4
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Plur
|
2
|
+
|
3
|
+
Opinionated development workflow and commonly used tools for Ruby on Rails based development.
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
As usual, add the Plur into your Gemfile:
|
10
|
+
|
11
|
+
gem 'plur'
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Several helpers will be automatically available to use:
|
16
|
+
|
17
|
+
- current_locale
|
18
|
+
- rtl_locales
|
19
|
+
- rtl?
|
20
|
+
- orientation
|
21
|
+
- notifications
|
22
|
+
- namespace_name
|
23
|
+
- body_attributes
|
24
|
+
- build_html
|
25
|
+
|
26
|
+
## Contributing
|
27
|
+
|
28
|
+
1. Fork it
|
29
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
30
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
32
|
+
5. Create new Pull Request
|
33
|
+
|
data/lib/plur/version.rb
CHANGED
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alif Rachmawadi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mab
|
@@ -34,16 +34,11 @@ extra_rdoc_files: []
|
|
34
34
|
files:
|
35
35
|
- .gitignore
|
36
36
|
- Gemfile
|
37
|
-
- LICENSE
|
38
|
-
- README.
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
39
|
- Rakefile
|
40
40
|
- images/slank-plur.jpg
|
41
41
|
- lib/plur.rb
|
42
|
-
- lib/plur/capistrano.rb
|
43
|
-
- lib/plur/capistrano/figaro.rb
|
44
|
-
- lib/plur/capistrano/foreman.rb
|
45
|
-
- lib/plur/capistrano/local.rb
|
46
|
-
- lib/plur/capistrano/upstart.rb
|
47
42
|
- lib/plur/helpers/view.rb
|
48
43
|
- lib/plur/railtie.rb
|
49
44
|
- lib/plur/version.rb
|
@@ -57,19 +52,20 @@ require_paths:
|
|
57
52
|
- lib
|
58
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
54
|
requirements:
|
60
|
-
- - '>='
|
55
|
+
- - ! '>='
|
61
56
|
- !ruby/object:Gem::Version
|
62
57
|
version: '0'
|
63
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
59
|
requirements:
|
65
|
-
- - '>='
|
60
|
+
- - ! '>='
|
66
61
|
- !ruby/object:Gem::Version
|
67
62
|
version: '0'
|
68
63
|
requirements: []
|
69
64
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
65
|
+
rubygems_version: 2.1.9
|
71
66
|
signing_key:
|
72
67
|
specification_version: 4
|
73
68
|
summary: Opinionated development workflow and commonly used tools for Ruby on Rails
|
74
69
|
based development.
|
75
70
|
test_files: []
|
71
|
+
has_rdoc:
|
data/README.markdown
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
# Plur
|
2
|
-
|
3
|
-
Opinionated development workflow and commonly used tools for Ruby on Rails based development.
|
4
|
-
|
5
|
-

|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
As usual, add the Plur into your Gemfile:
|
10
|
-
|
11
|
-
gem 'plur'
|
12
|
-
|
13
|
-
## Usage
|
14
|
-
|
15
|
-
Currently there are two parts on Plur, deployment and helper:
|
16
|
-
|
17
|
-
### Deployment
|
18
|
-
|
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 :)
|
20
|
-
|
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'
|
44
|
-
|
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
|
65
|
-
|
66
|
-
## Contributing
|
67
|
-
|
68
|
-
1. Fork it
|
69
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
-
5. Create new Pull Request
|
73
|
-
|
data/lib/plur/capistrano.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
-
namespace :figaro do
|
3
|
-
_cset :figaro_yaml, true
|
4
|
-
_cset :figaro_symlink, true
|
5
|
-
_cset(:figaro_output) { "#{shared_path}/application.yml" }
|
6
|
-
_cset(:figaro_config) { "#{latest_release}/config/application.yml" }
|
7
|
-
|
8
|
-
task :config, roles: :app do
|
9
|
-
figaro_tmpfile = "figaro-#{rails_env}"
|
10
|
-
|
11
|
-
if figaro_yaml
|
12
|
-
figaro_cmd = %Q(Figaro.env("#{rails_env}").to_yaml)
|
13
|
-
else
|
14
|
-
figaro_cmd = %Q(Figaro.vars("#{rails_env}").split)
|
15
|
-
end
|
16
|
-
|
17
|
-
run_locally "bundle exec rails runner 'puts #{figaro_cmd}' > #{figaro_tmpfile}"
|
18
|
-
transfer :up, figaro_tmpfile, figaro_output, via: :scp
|
19
|
-
run_locally "rm #{figaro_tmpfile}"
|
20
|
-
end
|
21
|
-
|
22
|
-
task :config_symlink, roles: :app do
|
23
|
-
run "ln -sf #{figaro_output} #{figaro_config}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
after 'deploy:setup' do
|
28
|
-
figaro.config if plur_callback
|
29
|
-
end
|
30
|
-
|
31
|
-
after 'deploy:finalize_update' do
|
32
|
-
figaro.config_symlink if plur_callback and figaro_symlink
|
33
|
-
end
|
34
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
-
namespace :foreman do
|
3
|
-
desc <<-DESC
|
4
|
-
Export the Procfile to upstart. Will use sudo if available.
|
5
|
-
|
6
|
-
You can override any of these defaults by setting the variables shown below.
|
7
|
-
|
8
|
-
set :foreman_format, "upstart"
|
9
|
-
set :foreman_location, "/etc/init"
|
10
|
-
set :foreman_procfile, "Procfile"
|
11
|
-
set :foreman_root, release_path
|
12
|
-
set :foreman_port, 5000
|
13
|
-
set :foreman_app, application
|
14
|
-
set :foreman_user, user
|
15
|
-
set :foreman_log, 'shared_path/log'
|
16
|
-
set :foreman_concurrency, false
|
17
|
-
DESC
|
18
|
-
task :export, roles: :app do
|
19
|
-
bundle_cmd = fetch(:bundle_cmd, "bundle")
|
20
|
-
foreman_format = fetch(:foreman_format, "upstart")
|
21
|
-
foreman_location = fetch(:foreman_location, "/etc/init")
|
22
|
-
foreman_procfile = fetch(:foreman_procfile, "Procfile")
|
23
|
-
foreman_port = fetch(:foreman_port, 5000)
|
24
|
-
foreman_root = fetch(:foreman_root, current_path)
|
25
|
-
foreman_app = fetch(:foreman_app, application)
|
26
|
-
foreman_user = fetch(:foreman_user, user)
|
27
|
-
foreman_log = fetch(:foreman_log, "#{shared_path}/log")
|
28
|
-
foreman_concurrency = fetch(:foreman_concurrency, false)
|
29
|
-
|
30
|
-
args = ["#{foreman_format} #{foreman_location}"]
|
31
|
-
args << "-f #{foreman_procfile}"
|
32
|
-
args << "-p #{foreman_port}"
|
33
|
-
args << "-d #{foreman_root}"
|
34
|
-
args << "-a #{foreman_app}"
|
35
|
-
args << "-u #{foreman_user}"
|
36
|
-
args << "-l #{foreman_log}"
|
37
|
-
args << "-c #{foreman_concurrency}" if foreman_concurrency
|
38
|
-
run "cd #{release_path} && #{sudo} #{bundle_cmd} exec foreman export #{args.join(' ')}"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
after 'deploy:update' do
|
43
|
-
foreman.export if plur_callback
|
44
|
-
end
|
45
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
-
namespace :local do
|
3
|
-
desc 'Run the precompile task locally and rsync with shared'
|
4
|
-
task :assets, roles: :web, except: { no_release: true } do
|
5
|
-
remote_path = "#{user}@#{domain}:#{shared_path}"
|
6
|
-
|
7
|
-
run_locally "bundle exec rake assets:precompile"
|
8
|
-
run_locally "rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{remote_path}"
|
9
|
-
run_locally "bundle exec rake assets:clean"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
namespace :deploy do
|
14
|
-
namespace :assets do
|
15
|
-
task :precompile, roles: :web, except: { no_release: true } do
|
16
|
-
local.assets
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
-
namespace :upstart do
|
3
|
-
_cset(:service_name) { application }
|
4
|
-
|
5
|
-
desc "Start the application services"
|
6
|
-
task :start, roles: :app do
|
7
|
-
run "#{sudo} service #{service_name} start"
|
8
|
-
end
|
9
|
-
|
10
|
-
desc "Stop the application services"
|
11
|
-
task :stop, roles: :app do
|
12
|
-
run "#{sudo} service #{service_name} stop"
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Restart the application services"
|
16
|
-
task :restart, roles: :app do
|
17
|
-
run "#{sudo} service #{service_name} start || #{sudo} service #{service_name} restart"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
after 'deploy:restart' do
|
22
|
-
upstart.restart if plur_callback
|
23
|
-
end
|
24
|
-
end
|