mina-padrino 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ab3f6239772d2ae77a379851ebb42482208e35d6
4
+ data.tar.gz: 5b36e07fcb38379a4692747a7ef41f6b0ffef896
5
+ SHA512:
6
+ metadata.gz: cdf304984ef1cd31dda1829a86dabb633b8d0dff2a5017e121d032418e45b10d5b167e4531e296a65a951da854455d939790f397843628bddf230be8b5e61cf5
7
+ data.tar.gz: 844913531c829c1b018f8ef122d9fec1562cd632df93aeddfd796b835dfd34b4520685b9f43ef9a59beace0707c67897804214010c5c98a513505acb09fb4f2c
data/.document ADDED
@@ -0,0 +1,3 @@
1
+ -
2
+ ChangeLog.md
3
+ LICENSE.txt
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ Gemfile.lock
2
+ doc/
3
+ pkg/
4
+ vendor/cache/*.gem
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown --title "mina-padrino Documentation" --protected
data/ChangeLog.md ADDED
@@ -0,0 +1,12 @@
1
+ ### 0.1.0 / 2015-06-15
2
+
3
+ * Initial release:
4
+ * Supports the following tasks:
5
+ * `padrino:console`
6
+ * `padrino:db:migrate`
7
+ * `padrino:db:create`
8
+ * `padrino:db:drop`
9
+ * `padrino:db:reset`
10
+ * `padrino:db:setup`
11
+ * `padrino:db:seed`
12
+
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org/'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake'
7
+ gem 'rubygems-tasks', '~> 0.2'
8
+
9
+ gem 'rspec', '~> 3.0'
10
+
11
+ gem 'kramdown'
12
+ gem 'yard', '~> 0.8'
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 Hal Brodigan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # mina-padrino
2
+
3
+ * [Homepage](https://github.com/postmodern/mina-padrino#readme)
4
+ * [Issues](https://github.com/postmodern/mina-padrino/issues)
5
+ * [Documentation](http://rubydoc.info/gems/mina-padrino/frames)
6
+ * [Email](mailto:postmodern.mod3 at gmail.com)
7
+
8
+ ## Description
9
+
10
+ [Mina][mina] tasks for deploying [Padrino][padrino] apps.
11
+
12
+ ## Features
13
+
14
+ * Sets `RACK_ENV=`
15
+
16
+ ### Tasks
17
+
18
+ Mina Task | Command
19
+ -------------------------|-----------------
20
+ `padrino:console` | `padrino console`
21
+ `padrino:db:migrate` | `rake db:migrate`
22
+ `padrino:db:create` | `rake db:create`
23
+ `padrino:db:drop` | `rake db:drop`
24
+ `padrino:db:reset` | `rake db:reset`
25
+ `padrino:db:setup` | `rake db:setup`
26
+ `padrino:db:seed` | `rake db:seed`
27
+
28
+ ## Examples
29
+
30
+ require 'mina/padrino'
31
+
32
+ ## Requirements
33
+
34
+ * [mina] ~> 0.3
35
+
36
+ ## Install
37
+
38
+ $ gem install mina-padrino
39
+
40
+ ## Gemfile
41
+
42
+ gem 'mina-padrino', require: false
43
+
44
+ ## Copyright
45
+
46
+ Copyright (c) 2015 Hal Brodigan
47
+
48
+ See {file:LICENSE.txt} for details.
49
+
50
+ [mina]: http://mina-deploy.github.io/mina/
51
+ [padrino]: http://www.padrinorb.com/
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'bundler'
7
+ rescue LoadError => e
8
+ warn e.message
9
+ warn "Run `gem install bundler` to install Bundler."
10
+ exit -1
11
+ end
12
+
13
+ begin
14
+ Bundler.setup(:development)
15
+ rescue Bundler::BundlerError => e
16
+ warn e.message
17
+ warn "Run `bundle install` to install missing gems."
18
+ exit e.status_code
19
+ end
20
+
21
+ require 'rake'
22
+
23
+ require 'rubygems/tasks'
24
+ Gem::Tasks.new
25
+
26
+ require 'rspec/core/rake_task'
27
+ RSpec::Core::RakeTask.new
28
+
29
+ task :test => :spec
30
+ task :default => :spec
31
+
32
+ require 'yard'
33
+ YARD::Rake::YardocTask.new
34
+ task :doc => :yard
data/gemspec.yml ADDED
@@ -0,0 +1,14 @@
1
+ name: mina-padrino
2
+ summary: mina tasks for padrino
3
+ description:
4
+ Mina tasks for deploying padrino apps.
5
+ license: MIT
6
+ authors: Postmodern
7
+ email: postmodern.mod3@gmail.com
8
+ homepage: https://github.com/postmodern/mina-padrino#readme
9
+
10
+ dependencies:
11
+ mina: ~> 0.3
12
+
13
+ development_dependencies:
14
+ bundler: ~> 1.0
@@ -0,0 +1,44 @@
1
+ require 'mina/bundler'
2
+ require 'mina/padrino/helpers'
3
+
4
+ # ## Settings
5
+ # Any and all of these settings can be overriden in your `deploy.rb`.
6
+
7
+ # ### padrino_env
8
+ # Sets the Padrino environment for `rake` and `padrino` commands.
9
+ #
10
+ # Note that changing this will NOT change the environment that your application
11
+ # is run in.
12
+
13
+ set_default :padrino_env, 'production'
14
+
15
+ # ### bundle_prefix
16
+ # Prefix for Bundler commands. Often to something like `RAILS_ENV=production
17
+ # bundle exec`.
18
+ #
19
+ # queue! "#{bundle_prefix} annotate -r"
20
+
21
+ set_default :bundle_prefix, lambda { %{RACK_ENV="#{padrino_env}" #{bundle_bin} exec} }
22
+
23
+ # ### rake
24
+ # The prefix for `rake` commands. Use like so:
25
+ #
26
+ # queue! "#{rake} db:migrate"
27
+
28
+ set_default :rake, lambda { %{#{bundle_prefix} rake} }
29
+
30
+ # ### padrino
31
+ # The prefix for `padrino` commands. Use like so:
32
+ #
33
+ # queue! "#{padrino} console"
34
+
35
+ set_default :padrino, lambda { %{#{bundle_prefix} padrino } }
36
+
37
+ namespace :padrino do
38
+ desc "Starts an interactive console."
39
+ task :console => :environment do
40
+ in_current_dir do
41
+ queue echo_cmd %[#{padrino} console]
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,84 @@
1
+ require 'mina/padrino/core'
2
+
3
+ # Macro used later by :rake, etc
4
+ make_run_task = lambda { |name, sample_args|
5
+ task name, [:arguments] => :environment do |t, args|
6
+ arguments = args[:arguments]
7
+ command = send name
8
+ unless arguments
9
+ puts %{You need to provide arguments. Try: mina "#{name}[#{sample_args}]"}
10
+ exit 1
11
+ end
12
+ queue echo_cmd %[cd "#{deploy_to!}/#{current_path!}" && #{command} #{arguments}]
13
+ end
14
+ }
15
+
16
+ namespace :padrino do
17
+ namespace :db do
18
+ # ### padrino:db:migrate
19
+ desc "Migrates the database."
20
+ task :migrate do
21
+ in_current_dir do
22
+ queue %{
23
+ echo "-----> Migrating database"
24
+ #{echo_cmd %[#{cd_current} && #{rake} db:migrate]}
25
+ }
26
+ end
27
+ end
28
+
29
+ # ### padrino:db:create
30
+ desc "Creates the database."
31
+ task :create do
32
+ in_current_dir do
33
+ queue %{
34
+ echo "-----> Creating database"
35
+ #{echo_cmd %[#{rake} db:create]}
36
+ }
37
+ end
38
+ end
39
+
40
+ # ### padrino:db:drop
41
+ desc "Drops the database."
42
+ task :drop do
43
+ in_current_dir do
44
+ queue %{
45
+ echo "-----> Dropping database!"
46
+ #{echo_cmd %[#{rake} db:drop]}
47
+ }
48
+ end
49
+ end
50
+
51
+ # ### padrino:db:reset
52
+ desc "Resets the database."
53
+ task :reset do
54
+ in_current_dir do
55
+ queue %{
56
+ echo "-----> Resetting database!"
57
+ #{echo_cmd %[#{rake} db:reset]}
58
+ }
59
+ end
60
+ end
61
+
62
+ # ### padrino:db:setup
63
+ desc "Setup the database."
64
+ task :setup do
65
+ in_current_dir do
66
+ queue %{
67
+ echo "-----> Setting up database"
68
+ #{echo_cmd %[#{rake} db:setup]}
69
+ }
70
+ end
71
+ end
72
+
73
+ # ### padrino:db:setup
74
+ desc "Seeds the database."
75
+ task :seed do
76
+ in_current_dir do
77
+ queue %{
78
+ echo "-----> Seeding database"
79
+ #{echo_cmd %[#{rake} db:seed]}
80
+ }
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,7 @@
1
+ module Mina
2
+ module Helpers
3
+ def in_current_dir(&block)
4
+ in_directory("#{deploy_to!}/#{current_path!}",&block)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Mina
2
+ module Padrino
3
+ # mina-padrino version
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ require 'mina/padrino/core'
2
+ require 'mina/padrino/db'
3
+ require 'mina/padrino/version'
@@ -0,0 +1,60 @@
1
+ # encoding: utf-8
2
+
3
+ require 'yaml'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gemspec = YAML.load_file('gemspec.yml')
7
+
8
+ gem.name = gemspec.fetch('name')
9
+ gem.version = gemspec.fetch('version') do
10
+ lib_dir = File.join(File.dirname(__FILE__),'lib')
11
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
12
+
13
+ require 'mina/padrino/version'
14
+ Mina::Padrino::VERSION
15
+ end
16
+
17
+ gem.summary = gemspec['summary']
18
+ gem.description = gemspec['description']
19
+ gem.licenses = Array(gemspec['license'])
20
+ gem.authors = Array(gemspec['authors'])
21
+ gem.email = gemspec['email']
22
+ gem.homepage = gemspec['homepage']
23
+
24
+ glob = lambda { |patterns| gem.files & Dir[*patterns] }
25
+
26
+ gem.files = `git ls-files`.split($/)
27
+ gem.files = glob[gemspec['files']] if gemspec['files']
28
+
29
+ gem.executables = gemspec.fetch('executables') do
30
+ glob['bin/*'].map { |path| File.basename(path) }
31
+ end
32
+ gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
33
+
34
+ gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
35
+ gem.test_files = glob[gemspec['test_files'] || '{test/{**/}*_test.rb']
36
+ gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
37
+
38
+ gem.require_paths = Array(gemspec.fetch('require_paths') {
39
+ %w[ext lib].select { |dir| File.directory?(dir) }
40
+ })
41
+
42
+ gem.requirements = gemspec['requirements']
43
+ gem.required_ruby_version = gemspec['required_ruby_version']
44
+ gem.required_rubygems_version = gemspec['required_rubygems_version']
45
+ gem.post_install_message = gemspec['post_install_message']
46
+
47
+ split = lambda { |string| string.split(/,\s*/) }
48
+
49
+ if gemspec['dependencies']
50
+ gemspec['dependencies'].each do |name,versions|
51
+ gem.add_dependency(name,split[versions])
52
+ end
53
+ end
54
+
55
+ if gemspec['development_dependencies']
56
+ gemspec['development_dependencies'].each do |name,versions|
57
+ gem.add_development_dependency(name,split[versions])
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'mina/padrino'
3
+
4
+ describe Mina::Padrino do
5
+ it "should have a VERSION constant" do
6
+ subject.const_get('VERSION').should_not be_empty
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'rspec'
2
+ require 'mina/padrino/version'
3
+
4
+ include Mina::Padrino
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina-padrino
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Postmodern
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mina
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ description: Mina tasks for deploying padrino apps.
42
+ email: postmodern.mod3@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files:
46
+ - ChangeLog.md
47
+ - LICENSE.txt
48
+ - README.md
49
+ files:
50
+ - ".document"
51
+ - ".gitignore"
52
+ - ".rspec"
53
+ - ".yardopts"
54
+ - ChangeLog.md
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - gemspec.yml
60
+ - lib/mina/padrino.rb
61
+ - lib/mina/padrino/core.rb
62
+ - lib/mina/padrino/db.rb
63
+ - lib/mina/padrino/helpers.rb
64
+ - lib/mina/padrino/version.rb
65
+ - mina-padrino.gemspec
66
+ - spec/padrino_spec.rb
67
+ - spec/spec_helper.rb
68
+ homepage: https://github.com/postmodern/mina-padrino#readme
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.4.7
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: mina tasks for padrino
92
+ test_files: []