luban-rails 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b65a8d1215c5fd3baf59d73dc1779f7c81688a49
4
+ data.tar.gz: fd54069044300e37dc51d9504ef2d4eb6660f0b4
5
+ SHA512:
6
+ metadata.gz: 013cb3ec9982dce56c649144d7ee286746bfce1b5eb79d8b5d9231035dd0b72209c1885f746e1bf0745dd4cd3f339e3707aa524c1b7fd816db9caebbce9e6d4a
7
+ data.tar.gz: c720691ee986e4c0e8e42cfddada63ffcd0486bae65dbf56d21eb2abc17f29882501ce2dbb80e55cbf69c94dad392ad77f6403f54bd1a865653ab43d9f8eb14c
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .DS_Store
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## Version 0.1.0 (Aug 04, 2016)
2
+
3
+ New features:
4
+ * Initialized Luban deployment application for Rails
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in luban-rails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Chi Man Lei
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Luban::Rails
2
+
3
+ Luban deployment application to manage Rails web application deployment and control
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'luban-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install luban-rails
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lubanrb/rails.
34
+
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
39
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "luban/rails"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,21 @@
1
+ require 'luban/rack'
2
+
3
+ module Luban
4
+ module Deployment
5
+ module Applications
6
+ class Rails < Luban::Deployment::Applications::Rack
7
+ protected
8
+
9
+ def include_default_templates_path
10
+ super
11
+ default_templates_paths.unshift(base_templates_path(__FILE__))
12
+ end
13
+
14
+ def set_default_application_parameters
15
+ super
16
+ linked_files.push('database.yml', 'secrets.yml')
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ module Luban
2
+ module Deployment
3
+ module Applications
4
+ class Rails
5
+ class Publisher < Luban::Deployment::Application::Publisher
6
+ protected
7
+
8
+ def publish!
9
+ super
10
+ publish_assets!
11
+ end
12
+
13
+ def publish_assets!
14
+ compile_assets!
15
+ cleanup_assets!
16
+ end
17
+
18
+ def compile_assets!
19
+ within(release_path) do
20
+ execute(bundle_cmd, :exec, :rake, "assets:precompile")
21
+ end
22
+ end
23
+
24
+ def cleanup_assets!
25
+ within(release_path) do
26
+ execute(bundle_cmd, :exec, :rake, "assets:clean")
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,11 @@
1
+ # It's recommended to use an environment variable, DATABASE_URL, to configure a database
2
+ # The database url can be setup in env_vars.rb of Luban:
3
+ #
4
+ # env_vars[:database_url] =
5
+ # "mysql2://username:password@host:port/<%= application_name %>_<%= stage %>?encoding=utf8&pool=5"
6
+ #
7
+ # Please refer to Rails Guides for the details of database url:
8
+ # http://guides.rubyonrails.org/configuring.html#configuring-a-database
9
+
10
+ <%= stage %>:
11
+ url: <%%= ENV["DATABASE_URL"] %>
@@ -0,0 +1,13 @@
1
+ # Be sure to restart your server when you modify the secret key.
2
+ #
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ #
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+ #
10
+ # Make sure the secret keys are kept private if you're sharing your code publicly.
11
+
12
+ <%= stage %>:
13
+ secret_key_base: <%%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,9 @@
1
+ module Luban
2
+ module Deployment
3
+ module Applications
4
+ class Rails
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ require 'luban'
2
+ require_relative 'rails/base'
3
+ require_relative 'rails/publisher'
4
+ require_relative 'rails/version'
@@ -0,0 +1 @@
1
+ require_relative "deployment/applications/rails"
File without changes
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'luban/deployment/applications/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "luban-rails"
8
+ spec.version = Luban::Deployment::Applications::Rails::VERSION
9
+ spec.authors = ["Rubyist Chi"]
10
+ spec.email = ["rubyist.chi@gmail.com"]
11
+
12
+ spec.summary = %q{Rails support for Luban}
13
+ spec.description = %q{Luban::Rails is a Luban deployment application to manage Rails web application deployment and control}
14
+ spec.homepage = "https://github.com/lubanrb/rails"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.required_ruby_version = ">= 2.1.0"
23
+ spec.add_dependency 'luban', ">= 0.7.1"
24
+ spec.add_dependency 'luban-rack', ">= 0.2.0"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.12"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "minitest", "~> 5.0"
29
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: luban-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rubyist Chi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-08-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: luban
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.7.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.7.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: luban-rack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.0'
83
+ description: Luban::Rails is a Luban deployment application to manage Rails web application
84
+ deployment and control
85
+ email:
86
+ - rubyist.chi@gmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - CHANGELOG.md
93
+ - Gemfile
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - bin/console
98
+ - bin/setup
99
+ - lib/luban-rails.rb
100
+ - lib/luban/deployment/applications/rails.rb
101
+ - lib/luban/deployment/applications/rails/base.rb
102
+ - lib/luban/deployment/applications/rails/publisher.rb
103
+ - lib/luban/deployment/applications/rails/templates/database.yml.erb
104
+ - lib/luban/deployment/applications/rails/templates/secrets.yml.erb
105
+ - lib/luban/deployment/applications/rails/version.rb
106
+ - lib/luban/rails.rb
107
+ - luban-rails.gemspec
108
+ homepage: https://github.com/lubanrb/rails
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 2.1.0
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.5.1
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: Rails support for Luban
132
+ test_files: []