guard-yarn 1.0.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: 7af325d85e24f4d13281c68106fdec835fa0ff5d
4
+ data.tar.gz: ae977c451b5bf4ba403d239bbffb7f7a68972860
5
+ SHA512:
6
+ metadata.gz: 1daa12c09e788e82bc7e4b249dc87dac595cceca1f791b20ab28ddf73a6247926a743d3141052384f3b7f7e2a9f16456a2cf7fcfeb5732bd3dd90c120d33e568
7
+ data.tar.gz: 19a07c65e3b6e79c8634aa1fb0c5d0434846745ea5e91540072aac6c9debed95c94e3941bc2053220e4899c854e577c70b269e3936eb00728e4afcdf9d340ff7
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,145 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ # DisabledByDefault: true
6
+ DisplayCopNames: true
7
+ Exclude:
8
+ - '**/templates/**/*'
9
+ - '**/vendor/**/*'
10
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
11
+ - 'db/schema.rb'
12
+ - 'bin/setup'
13
+ - 'Guardfile'
14
+
15
+ # Prefer &&/|| over and/or.
16
+ Style/AndOr:
17
+ Enabled: true
18
+
19
+ # Do not use braces for hash literals when they are the last argument of a
20
+ # method call.
21
+ Style/BracesAroundHashParameters:
22
+ Enabled: true
23
+
24
+ # Align `when` with `case`.
25
+ Layout/CaseIndentation:
26
+ Enabled: true
27
+
28
+ # Align comments with method definitions.
29
+ Layout/CommentIndentation:
30
+ Enabled: true
31
+
32
+ # No extra empty lines.
33
+ Layout/EmptyLines:
34
+ Enabled: true
35
+
36
+ # In a regular class definition, no empty lines around the body.
37
+ Layout/EmptyLinesAroundClassBody:
38
+ Enabled: true
39
+
40
+ # In a regular method definition, no empty lines around the body.
41
+ Layout/EmptyLinesAroundMethodBody:
42
+ Enabled: true
43
+
44
+ # In a regular module definition, no empty lines around the body.
45
+ Layout/EmptyLinesAroundModuleBody:
46
+ Enabled: true
47
+
48
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
49
+ Style/HashSyntax:
50
+ Enabled: true
51
+
52
+ # Method definitions after `private` or `protected` isolated calls need one
53
+ # extra level of indentation.
54
+ Layout/IndentationConsistency:
55
+ Enabled: true
56
+ EnforcedStyle: rails
57
+
58
+ # Two spaces, no tabs (for indentation).
59
+ Layout/IndentationWidth:
60
+ Enabled: true
61
+
62
+ Layout/SpaceAfterColon:
63
+ Enabled: true
64
+
65
+ Layout/SpaceAfterComma:
66
+ Enabled: true
67
+
68
+ Layout/SpaceAroundEqualsInParameterDefault:
69
+ Enabled: true
70
+
71
+ Layout/SpaceAroundKeyword:
72
+ Enabled: true
73
+
74
+ Layout/SpaceAroundOperators:
75
+ Enabled: true
76
+
77
+ Layout/SpaceBeforeFirstArg:
78
+ Enabled: true
79
+
80
+ # Defining a method with parameters needs parentheses.
81
+ Style/MethodDefParentheses:
82
+ Enabled: true
83
+
84
+ # Use `foo {}` not `foo{}`.
85
+ Layout/SpaceBeforeBlockBraces:
86
+ Enabled: true
87
+
88
+ # Use `foo { bar }` not `foo {bar}`.
89
+ Layout/SpaceInsideBlockBraces:
90
+ Enabled: true
91
+
92
+ # Use `{ a: 1 }` not `{a:1}`.
93
+ Layout/SpaceInsideHashLiteralBraces:
94
+ Enabled: true
95
+
96
+ Layout/SpaceInsideParens:
97
+ Enabled: true
98
+
99
+ # Check quotes usage according to lint rule below.
100
+ Style/StringLiterals:
101
+ Enabled: true
102
+ EnforcedStyle: double_quotes
103
+
104
+ # Detect hard tabs, no hard tabs.
105
+ Layout/Tab:
106
+ Enabled: true
107
+
108
+ # Blank lines should not have any spaces.
109
+ Layout/TrailingBlankLines:
110
+ Enabled: true
111
+
112
+ # No trailing whitespace.
113
+ Layout/TrailingWhitespace:
114
+ Enabled: true
115
+
116
+ # Use quotes for string literals when they are enough.
117
+ Style/UnneededPercentQ:
118
+ Enabled: true
119
+
120
+ Layout/AlignParameters:
121
+ EnforcedStyle: with_fixed_indentation
122
+
123
+ Layout/IndentationConsistency:
124
+ EnforcedStyle: rails
125
+
126
+ Style/EmptyMethod:
127
+ Enabled: false
128
+
129
+ Style/Documentation:
130
+ Enabled: false
131
+
132
+ Style/ClassAndModuleChildren:
133
+ EnforcedStyle: compact
134
+ # Align `end` with the matching keyword or starting expression except for
135
+ # assignments, where it should be aligned with the LHS.
136
+ Lint/EndAlignment:
137
+ Enabled: true
138
+ EnforcedStyleAlignWith: variable
139
+
140
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
141
+ Lint/RequireParentheses:
142
+ Enabled: true
143
+
144
+ Metrics/LineLength:
145
+ Enabled: false
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 guard-yarn.gemspec
6
+ gemspec
@@ -0,0 +1,23 @@
1
+ # Guard::Yarn
2
+
3
+ Guard plugin to automatically run yarn install when package.json changes
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ group :development do
11
+ gem "guard-yarn"
12
+ end
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle exec guard init yarn
18
+
19
+
20
+
21
+ ## Contributing
22
+
23
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cristianbica/guard-yarn.
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "guard/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,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "guard/yarn/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "guard-yarn"
9
+ spec.version = Guard::YarnVersion::VERSION
10
+ spec.authors = ["Cristian Bica"]
11
+ spec.email = ["cristian.bica@gmail.com"]
12
+
13
+ spec.summary = "Guard plugin for YARN"
14
+ spec.description = "Guard plugin for YARN. Run yarn whenever package.json changes"
15
+ spec.homepage = "https://github.com/cristianbica/guard-yarn"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_dependency "guard-compat", "~> 1.1"
26
+ spec.add_development_dependency "bundler", "~> 1.15"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "guard/compat/plugin"
4
+ require "English"
5
+
6
+ class Guard::Yarn < Guard::Plugin
7
+ def initialize(options = {})
8
+ super
9
+ end
10
+
11
+ def start
12
+ yarn_install
13
+ end
14
+
15
+ def reload
16
+ yarn_install
17
+ end
18
+
19
+ def run_all
20
+ yarn_install
21
+ end
22
+
23
+ def run_on_additions(_paths)
24
+ yarn_install
25
+ end
26
+
27
+ def run_on_modifications(_paths)
28
+ yarn_install
29
+ end
30
+
31
+ private
32
+
33
+ def yarn_install
34
+ Guard::Compat::UI.info "YARN: Running"
35
+ system("yarn install")
36
+ if $CHILD_STATUS.success?
37
+ Guard::Compat::UI.info "YARN: Successfully installed packages"
38
+ else
39
+ Guard::Compat::UI.error "YARN: Failed to install packages"
40
+ end
41
+ $CHILD_STATUS.success?
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ guard :yarn do
2
+ watch("package.json")
3
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Guard
4
+ module YarnVersion
5
+ VERSION = "1.0.0"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-yarn
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Cristian Bica
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard-compat
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
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.15'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.15'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Guard plugin for YARN. Run yarn whenever package.json changes
56
+ email:
57
+ - cristian.bica@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - Gemfile
65
+ - README.md
66
+ - Rakefile
67
+ - bin/console
68
+ - bin/setup
69
+ - guard-yarn.gemspec
70
+ - lib/guard/yarn.rb
71
+ - lib/guard/yarn/templates/Guardfile
72
+ - lib/guard/yarn/version.rb
73
+ homepage: https://github.com/cristianbica/guard-yarn
74
+ licenses: []
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.6.11
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Guard plugin for YARN
96
+ test_files: []