gulp-runner 0.0.1

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: 797af6a7d8a19df55fbd580dc98f096b0e524ad8
4
+ data.tar.gz: ba68a663d9acade5c0d2e03bbbf785f8f2007de0
5
+ SHA512:
6
+ metadata.gz: c90185518463c096d993d2ae47c52e58362576859e92ca12d046976436dbb374241121a5065748508780d92687bd6b29b1d2716ecfe096a29d7ecf396e501d96
7
+ data.tar.gz: d69ddd2af3a481cb00794e67ed7125f14667dcfbb5cb1f60f79a7fa1153caeb459917f62fd073e5854ad6bef224f20c58d41e512ef76f584e187cdc31620c21c
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
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,10 @@
1
+ Gulp-runner
2
+ ============
3
+
4
+ [![Build Status](https://travis-ci.org/hirtie-maxim/gulp-runner.svg)][travis]
5
+ [![Coverage Status](https://img.shields.io/coveralls/hirtie-maxim/gulp-runner.svg)][coveralls]
6
+
7
+ [travis]: https://travis-ci.org/hirtie-maxim/gulp-runner
8
+ [coveralls]: https://coveralls.io/r/hirtie-maxim/gulp-runner
9
+
10
+ This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,24 @@
1
+ module GulpRunner
2
+ class CommandUtils
3
+ def self.get_command(command_name)
4
+ entries = Dir.entries(GulpRunner.root_path)
5
+ npm_path = File.join(GulpRunner.root_path, 'node_modules', '.bin')
6
+ command = CommandUtils.find_command(command_name, [npm_path])
7
+
8
+ return command if !command.nil?
9
+ raise Exception
10
+ end
11
+ # http://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby
12
+ def self.find_command(cmd, paths = [])
13
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
14
+ paths += ENV['PATH'].split(File::PATH_SEPARATOR)
15
+ paths.each do |path|
16
+ exts.each do |ext|
17
+ exe = File.join(path, "#{cmd}#{ext}")
18
+ return exe if (File.executable?(exe) && File.file?(exe))
19
+ end
20
+ end
21
+ nil
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,30 @@
1
+ module GulpRunner
2
+ class Gulp
3
+ def self.list
4
+ `#{gulp} --cwd #{cwd} --tasks`
5
+ end
6
+
7
+ def self.run(task_name = "default")
8
+ `#{gulp} --cwd #{cwd} #{task_name}`
9
+ end
10
+
11
+ private
12
+ def self.gulp_file_path
13
+ GulpRunner.gulp_file_path
14
+ end
15
+
16
+ def self.cwd
17
+ GulpRunner.node_modules_path
18
+ end
19
+
20
+ def self.gulp
21
+ begin
22
+ gulp = CommandUtils.get_command('gulp')
23
+ rescue
24
+ $stderr.puts ["Gulp.js not found! You can install Gulp.js using Node and npm:",
25
+ "$ npm install gulp -g",
26
+ "For more info see http://gulpjs.com/"].join("\n")
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ module GulpRunner
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load "tasks/gulp.rake"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Gulprunner
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,13 @@
1
+ module GulpRunner
2
+ require 'gulp-runner/railtie' if defined?(Rails)
3
+ require 'gulp-runner/command_utils'
4
+ require 'gulp-runner/gulp'
5
+
6
+ class << self
7
+ attr_accessor :gulp_file_path, :root_path, :node_modules_path
8
+ end
9
+
10
+ @gulp_file_path = File.join('gulpfile.js')
11
+ @node_modules_path = '.'
12
+ @root_path = Dir.pwd
13
+ end
@@ -0,0 +1,23 @@
1
+ # desc "Explaining what the task does"
2
+ # task :gulprunner do
3
+ # # Task goes here
4
+ # end
5
+
6
+ namespace :gulp do
7
+ desc 'List all gulp tasks'
8
+ task :list do
9
+ puts GulpRunner::Gulp.list
10
+ end
11
+
12
+ namespace :run do
13
+ desc 'Runs default task'
14
+ task :default do
15
+ puts GulpRunner::Gulp.run
16
+ end
17
+ end
18
+
19
+ desc 'Run gulp task'
20
+ task :run, [:task_name] do |t, args|
21
+ puts GulpRunner::Gulp.run args[:task_name]
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gulp-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Hirtie Maxim
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Rails integration for gulp.
56
+ email: hirtie.maxim@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - MIT-LICENSE
62
+ - README.md
63
+ - lib/gulp-runner.rb
64
+ - lib/gulp-runner/command_utils.rb
65
+ - lib/gulp-runner/gulp.rb
66
+ - lib/gulp-runner/railtie.rb
67
+ - lib/gulp-runner/version.rb
68
+ - lib/tasks/gulp.rake
69
+ homepage: https://github.com/hirtie-maxim/gulp-runner
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.2.2
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Gulp for Rails
93
+ test_files: []