mina1-yarn 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 967e972af4ec91cc3e16d21ac493a1ec1e189646
4
+ data.tar.gz: fd767b8b80640023cb24710a7acc9b091029690a
5
+ SHA512:
6
+ metadata.gz: 83b21f264895d69e6fec72f46a31eb2eb80550ad3da4e001a25bd705ff8d0b58184ffd27e32cc41575a7dc627ccd0e1a4684fc803f77530de64e42b5ec3b9167
7
+ data.tar.gz: a1b576b942ee6f9f0832bd13ac00fa7c142e835a4f3a4dcc3640603225b67f4110fb5efea96ce9394cb9aa4d0ba5b3eacbc979b93d27c97fdb0458a8545c98d0
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in mina-yarn.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 wootaw
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.
@@ -0,0 +1,71 @@
1
+ # Mina-yarn
2
+
3
+ Yarn tasks for mina 1.x
4
+
5
+ ## Installation
6
+
7
+ To use it in your project's deployment process install this gem with the following command:
8
+
9
+ $ gem install mina-yarn
10
+
11
+ Add the following line to your deploy.rb script:
12
+
13
+ ```ruby
14
+ require 'mina/yarn'
15
+ ```
16
+
17
+ This enables you to use the `yarn:install` task in your deploy script.
18
+
19
+ ## Configuration
20
+
21
+ __Important:__ The `:yarn_bin` defaults to `yarn`
22
+
23
+ __Important:__ The `:yarn_options` defaults to `--production`
24
+
25
+ To change `yarn_bin` add `yarn_options` in your `deploy.rb` file:
26
+
27
+ ```Ruby
28
+ set :yarn_bin, 'yarn_other'
29
+ set :yarn_options, lambda { %{--production --ignore-engines} }
30
+ ```
31
+
32
+ ## Example deploy script
33
+
34
+ ```Ruby
35
+ require 'mina/bundler'
36
+ require 'mina/rails'
37
+ require 'mina/git'
38
+ require 'mina/yarn' # <---- Added this line
39
+
40
+ set :domain, 'my-page.com'
41
+ set :deploy_to, '/home/deploy/www/...'
42
+ set :repository, 'https://github.com/...'
43
+ set :branch, 'master'
44
+ set :yarn_bin, '.yarn_other' # <--- Added this line
45
+ set :yarn_options, lambda { %{--production --ignore-engines} } # <--- Added this line
46
+
47
+ ...
48
+
49
+ desc "Deploys the current version to the server."
50
+ task :deploy => :remote_environment do
51
+
52
+ deploy do
53
+ invoke :'git:clone'
54
+ invoke :'deploy:link_shared_paths'
55
+ invoke :'bundle:install'
56
+ invoke :'yarn:install' # <----- Added this line
57
+ invoke :'rails:assets_precompile'
58
+ invoke :'deploy:cleanup'
59
+
60
+ on :launch do
61
+ in_path(fetch(:current_path)) do
62
+ command %[touch "#{fetch(:deploy_to)}/tmp/restart.txt"]
63
+ end
64
+ end
65
+ end
66
+ end
67
+ ```
68
+
69
+ ## License
70
+
71
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "mina/yarn"
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(__FILE__)
@@ -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,8 @@
1
+ require "mina/yarn/version"
2
+ require "mina/yarn/defaults"
3
+ require "mina/yarn/tasks"
4
+
5
+ module Mina
6
+ module Yarn
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ set :yarn_bin, "yarn"
2
+ set :yarn_options, lambda { %{--production} }
@@ -0,0 +1,18 @@
1
+ namespace :yarn do
2
+
3
+ desc "Install package dependencies using yarn."
4
+ task :install do
5
+ command %{
6
+ echo "-----> Installing package dependencies using yarn"
7
+ #{echo_cmd %[#{fetch(:yarn_bin)} install #{fetch(:yarn_options)}]}
8
+ }
9
+ end
10
+
11
+ desc "Install latest version of yarn."
12
+ task :setup do
13
+ command %{
14
+ echo "-----> Installing yarn"
15
+ #{echo_cmd %[npm install -g yarn]}
16
+ }
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module Mina
2
+ module Yarn
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "mina/yarn/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mina1-yarn"
8
+ spec.version = Mina::Yarn::VERSION
9
+ spec.authors = ["wootaw"]
10
+ spec.email = ["wootaw@gmail.com"]
11
+
12
+ spec.summary = %q{Yarn tasks for mina 1.x}
13
+ spec.homepage = "https://github.com/wootaw/mina-yarn"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against " \
22
+ # "public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.16"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rspec", "~> 3.0"
35
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina1-yarn
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - wootaw
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description:
56
+ email:
57
+ - wootaw@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - lib/mina/yarn.rb
72
+ - lib/mina/yarn/defaults.rb
73
+ - lib/mina/yarn/tasks.rb
74
+ - lib/mina/yarn/version.rb
75
+ - mina-yarn.gemspec
76
+ homepage: https://github.com/wootaw/mina-yarn
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.5.1
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Yarn tasks for mina 1.x
100
+ test_files: []