middleman-npm_build 0.0.4

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: 5a1966f1446601121842744dc07369714bcb2a30
4
+ data.tar.gz: 12e4021af4822f0b82e7bdfc5d21d5fcadc9d070
5
+ SHA512:
6
+ metadata.gz: 1d0cc39e8bccd549b215e7c10bb58e6e897f0a062516a63125eb08bb8ab0280b2df89efc9d2dc8e14522a060da73818921aa2fea285d73301ebcef6279ef2386
7
+ data.tar.gz: 4d2199df73a489aa6cfa6814fc056d30793ff7ce33f319933aedd8345caf46b5945c3ec312af239d9d87afec15f10f75514130ed85ebd0043022bda8c736aef7
@@ -0,0 +1,5 @@
1
+ # Ignore bundler lock file
2
+ /Gemfile.lock
3
+
4
+ # Ignore pkg folder
5
+ /pkg
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ # If you do not have OpenSSL installed, update
2
+ # the following line to use "http://" instead
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in middleman-npm_build.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem 'rake'
10
+ gem 'rdoc'
11
+ gem 'yard'
12
+ end
13
+
14
+ group :test do
15
+ gem 'cucumber'
16
+ gem 'fivemat'
17
+ gem 'aruba'
18
+ gem 'rspec'
19
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jesse Hixson
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # Middleman::NpmBuild
2
+
3
+ Runs a generic `npm` build command after your Middleman site has finished building.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your Middleman app's `Gemfile`:
8
+
9
+ gem 'middleman-npm_build'
10
+
11
+ And then execute:
12
+
13
+ $ bundle install
14
+
15
+ ## Usage
16
+
17
+ Add this line to your `config.rb`:
18
+
19
+ `activate :npm_build`
20
+
21
+ This will run `npm run build` after your Middleman site has finished building.
22
+
23
+ You can also pass a custom build function (defined in your `package.json` file) as below:
24
+
25
+ `activate :npm_build, build_command: 'custom_build_function'`
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/jhixson/middleman-npm_build/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
@@ -0,0 +1,14 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
+ t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
8
+ end
9
+
10
+ require 'rake/clean'
11
+
12
+ task test: ['cucumber']
13
+
14
+ task default: :test
@@ -0,0 +1,4 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ require 'middleman-core'
3
+ require 'middleman-core/step_definitions'
4
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-npm_build')
@@ -0,0 +1,18 @@
1
+ # Require core library
2
+ require 'middleman-core'
3
+
4
+ # Extension namespace
5
+ class NpmBuild < ::Middleman::Extension
6
+ option :build_command, 'build', 'Your custom build command'
7
+
8
+ def initialize(app, options_hash={}, &block)
9
+ super
10
+
11
+ build_command = options.build_command
12
+ app.after_build do |builder|
13
+ system "npm run #{build_command}"
14
+ end
15
+ end
16
+ end
17
+
18
+ NpmBuild.register(:npm_build)
@@ -0,0 +1 @@
1
+ require 'middleman-npm_build'
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "middleman-npm_build"
6
+ s.version = "0.0.4"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Jesse Hixson"]
9
+ s.email = ["hixsonj@gmail.com"]
10
+ s.summary = "Runs an npm build command after your middleman build process."
11
+ s.description = "Runs `npm run build` after the middleman build command finishes. You can configure your build process via your package.json file, or pass in a custom build process name."
12
+ s.license = "MIT"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ # The version of middleman-core your extension depends on
20
+ s.add_runtime_dependency("middleman-core", ["~> 3.3"])
21
+
22
+ # Additional dependencies
23
+ # s.add_runtime_dependency("gem-name", "gem-version")
24
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-npm_build
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Jesse Hixson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: middleman-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.3'
27
+ description: Runs `npm run build` after the middleman build command finishes. You
28
+ can configure your build process via your package.json file, or pass in a custom
29
+ build process name.
30
+ email:
31
+ - hixsonj@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - ".gitignore"
37
+ - Gemfile
38
+ - LICENSE.txt
39
+ - README.md
40
+ - Rakefile
41
+ - features/support/env.rb
42
+ - lib/middleman-npm_build.rb
43
+ - lib/middleman_extension.rb
44
+ - middleman-npm_build.gemspec
45
+ homepage:
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.2.2
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Runs an npm build command after your middleman build process.
69
+ test_files:
70
+ - features/support/env.rb