jekyll-grunt 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 80471d08eb88d88b70bb84b68026b45e6ef87b48
4
+ data.tar.gz: 77837c7b0deca4478d74078ffc9ad1953fc23834
5
+ SHA512:
6
+ metadata.gz: c3f1a2c633daeb80c1053cca265316de23cad0e3f07662d01c57a9986f0ecd15365ac2fa1587b95ab262044bfa94e1706e7ed9e5953a1e4ba0ea4ebf8a9e7dcf
7
+ data.tar.gz: abcfdb51bc5fe46db6723bb24914f7a5079502e03742bfd2b73c6bc3e3a4494f6478ef6b1d908597e084a10c209405a0a7acc61c67ca1efba903ae0bc748e935
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Sai Ashirwad Informatia
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,57 @@
1
+ # Jekyll Grunt
2
+
3
+ [![build status](https://gitlab.com/SaiLabs/Jekyll-Grunt/badges/master/build.svg)](https://gitlab.com/SaiLabs/Jekyll-Grunt/commits/master)
4
+ [![Gem Version](https://badge.fury.io/rb/jekyll-grunt.svg)](https://badge.fury.io/rb/jekyll-grunt)
5
+
6
+ This plugin provides support for performing **Grunt** tasks easily
7
+
8
+ ### Installation
9
+
10
+ This plugin is available as a [RubyGem](https://rubygems.org/gems/jekyll-grunt/)
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```
15
+ gem 'jekyll-grunt'
16
+ ```
17
+
18
+ And then execute the `bundle install` command to install the gem.
19
+
20
+ Alternatively, you can also manually install the gem using the following command:
21
+
22
+ ```
23
+ $ gem install jekyll-grunt
24
+ ```
25
+
26
+ After the plugin has been installed successfully, add the following lines to your _config.yml in order to tell Jekyll to use the plugin:
27
+
28
+ ```yaml
29
+ gems:
30
+ - jekyll-grunt
31
+ ```
32
+
33
+ #### Perform Grunt Task using Jekyll Config
34
+
35
+ ```yaml
36
+ grunt:
37
+ - clean
38
+ - uglify
39
+ - stage:prod:copy:production
40
+ ```
41
+
42
+ Above line executes your task that you usually perform by calling below
43
+
44
+ ```
45
+ grunt clean uglify stage:prod:copy:production
46
+ ```
47
+
48
+
49
+ ### Contribute
50
+
51
+ Fork this repository, make your changes and then issue a pull request. If you find bugs or have new ideas that you do not want to implement yourself, file a bug report.
52
+
53
+ ### Copyright
54
+
55
+ Copyright (c) 2016 Sai Ashirwad Informatia
56
+
57
+ License: MIT
@@ -0,0 +1,18 @@
1
+ # Generate script code for Google Analytics with Liquid Tag
2
+ require 'jekyll'
3
+ require 'jekyll/plugin_grunt'
4
+ require 'jekyll/plugin_version'
5
+
6
+ # Register Jekyll Site Post Read hook of Grunt plugin
7
+ Jekyll::Hooks.register :site, :after_init do |jekyll| # jekyll here acts as site global object
8
+ JekyllBower = Jekyll::Grunt.new()
9
+ JekyllGrunt.resolve(jekyll)
10
+ puts "Reading newly generated Grunt files\n"
11
+ jekyll.reset()
12
+ puts "Jekyll site reset done\n"
13
+ jekyll.setup()
14
+ puts "Jekyll site setup done\n"
15
+ jekyll.read()
16
+ puts "Jekyll site read done\n"
17
+ puts "Looks like everything is ready\n"
18
+ end
@@ -0,0 +1,35 @@
1
+ require 'uri'
2
+
3
+ module Jekyll
4
+ class Grunt
5
+ def initialize()
6
+ puts "Checking if NPM is available\n"
7
+ fail unless system('which npm')
8
+ puts "Great, NPM is available\n"
9
+ puts "Checking if Grunt is available\n"
10
+ unless system('which grunt')
11
+ puts "Grunt not available\n"
12
+ puts "Installing grunt\n"
13
+ system('npm install -g grunt-cli')
14
+ puts "Installation completed\n"
15
+ else
16
+ puts "Great, Grunt is available\n"
17
+ end
18
+ end
19
+
20
+ def resolve(site)
21
+ if File.exists?("Gruntfile.js")
22
+ puts "Performing Grunt Task\n"
23
+ if site.config['grunt']
24
+ puts "Resolving grunt individually configured in config" + "\n"
25
+ site.config['bower'].each do |task|
26
+ command = "grunt " + task
27
+ system(command)
28
+ end
29
+ end
30
+ else
31
+ puts "Gruntfile.js does not exists!\n"
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,6 @@
1
+
2
+ module Jekyll
3
+ class Grunt
4
+ VERSION = "1.0.0".freeze
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-grunt
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Rohan Sakhale
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.0
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.0
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.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
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
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 5.9.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 5.9.0
69
+ description: This plugin helps perform grunt task easily
70
+ email: rohansakhale@gmail.com
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - LICENSE.md
76
+ - README.md
77
+ - lib/jekyll-grunt.rb
78
+ - lib/jekyll/plugin_grunt.rb
79
+ - lib/jekyll/plugin_version.rb
80
+ homepage: https://gitlab.com/SaiLabs/Jekyll-Grunt
81
+ licenses:
82
+ - MIT
83
+ metadata:
84
+ allowed_push_host: https://rubygems.org
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.5.1
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: This plugin helps perform grunt task easily
105
+ test_files: []