plur 0.0.3 → 0.0.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: ba75a18a139f24af74eef957214ee607f774374c
4
- data.tar.gz: 339fa96c7be54ad3c396b8426b58c4d939505e0d
3
+ metadata.gz: f21421aaad32806bb70c97178a8bef8a7583abbf
4
+ data.tar.gz: 8dc3966101c5b26fc1a22f94a6bdad89bcca45b5
5
5
  SHA512:
6
- metadata.gz: 9394bff83dbbe6a3661d160984d10dc30a701cb149cfb5b291c0a727a34b5c797e2a985ec742f5d7966c237eab9d341b51e35a69999275fa922069f0dca89627
7
- data.tar.gz: cf7525d61eb17a0ccd852e9e9190a5cb68ff3e932182ba1afc938ee89ec0316c1bb24ea6b38b9cf4207d7a12048437b0e85d881b59cc3878b8a0e75941130a65
6
+ metadata.gz: 9661c9a16374d3416986878d40571fd076507b1356ba59cc7bffb77150d37fcda1c4f98142a60daaaf88720d63f2299eb90380186935c6ac5696f57cdd3d180c
7
+ data.tar.gz: 5cd184a1a28284a8fd46c16c7d79656664f4dbd7e5e8677b84ade502cd38413385189de0a6277720e18dba18ec60c367edd53df161f73db92bbba960487fed3b
data/README.markdown CHANGED
@@ -1,24 +1,67 @@
1
1
  # Plur
2
2
 
3
- TODO: Write a gem description
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
- Add this line to your application's Gemfile:
9
+ As usual, add the Plur into your Gemfile:
8
10
 
9
11
  gem 'plur'
10
12
 
11
- And then execute:
13
+ ## Usage
12
14
 
13
- $ bundle
15
+ Currently there are two parts on Plur, deployment and helper:
14
16
 
15
- Or install it yourself as:
17
+ ### Deployment
16
18
 
17
- $ gem install plur
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
- ## Usage
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
- TODO: Write usage instructions here
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
@@ -1,4 +1,8 @@
1
+ # recipes
1
2
  require "plur/capistrano/foreman"
2
3
  require "plur/capistrano/upstart"
3
4
  require "plur/capistrano/figaro"
4
- require "plur/capistrano/local"
5
+
6
+ Capistrano::Configuration.instance(:must_exist).load do
7
+ _cset :plur_callback, true
8
+ end
@@ -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', 'figaro:config'
27
+ after 'deploy:setup' do
28
+ figaro.config if plur_callback
29
+ end
24
30
 
25
31
  after 'deploy:finalize_update' do
26
- run "ln -sf #{figaro_output} #{figaro_config}" if figaro_symlink
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/app")
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', 'foreman:export'
42
+ after 'deploy:update' do
43
+ foreman.export if plur_callback
44
+ end
43
45
  end
@@ -10,7 +10,6 @@ Capistrano::Configuration.instance(:must_exist).load do
10
10
  end
11
11
  end
12
12
 
13
- # TODO: allow to turn it off
14
13
  namespace :deploy do
15
14
  namespace :assets do
16
15
  task :precompile, roles: :web, except: { no_release: true } do
@@ -1,6 +1,6 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
  namespace :upstart do
3
- _cset(:service_name) { "app/#{application}" }
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', 'upstart:restart'
21
+ after 'deploy:restart' do
22
+ upstart.restart if plur_callback
23
+ end
22
24
  end
data/lib/plur/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plur
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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{Quite useful things}
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.3
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-25 00:00:00.000000000 Z
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: Quite useful things
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: Quite useful things
73
+ summary: Opinionated development workflow and commonly used tools for Ruby on Rails
74
+ based development.
72
75
  test_files: []