go_script 0.1.0 → 0.1.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 +4 -4
- data/lib/go_script/go.rb +23 -10
- data/lib/go_script/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f06c78febb64d1a7e1e56f643e356b22a835ce58
|
4
|
+
data.tar.gz: 33df78ea5db8e6e78f4ce4fb7497521392f0eb2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 945826e7ee5e3db384e1254c05ddc6e18fae49aaaac0389193d2463b947fda634ff7601fd8229421d57e33b4687c279c7197c90e9a91a7cceff1f04d204b2222
|
7
|
+
data.tar.gz: e36d4822609be75a075f94ff60f4b833f2024926140ce49cf99b87bc290fdb39cde88d11c6703900da2de1833faced136250fcc030d7507d6f3ad3d58bcda36a
|
data/lib/go_script/go.rb
CHANGED
@@ -52,8 +52,8 @@ module GoScript
|
|
52
52
|
exec_cmd 'bundle install'
|
53
53
|
end
|
54
54
|
|
55
|
-
def update_gems(gems)
|
56
|
-
exec_cmd "bundle update #{gems}"
|
55
|
+
def update_gems(gems = '')
|
56
|
+
exec_cmd "bundle update #{args_to_string gems}"
|
57
57
|
exec_cmd 'git add Gemfile.lock'
|
58
58
|
end
|
59
59
|
|
@@ -68,12 +68,26 @@ module GoScript
|
|
68
68
|
JEKYLL_BUILD_CMD = 'bundle exec jekyll build --trace'
|
69
69
|
JEKYLL_SERVE_CMD = 'bundle exec jekyll serve -w --trace'
|
70
70
|
|
71
|
-
def
|
72
|
-
|
71
|
+
def args_to_string(args)
|
72
|
+
args ||= ''
|
73
|
+
(args.instance_of? Array) ? args.join(' ') : args
|
73
74
|
end
|
74
75
|
|
75
|
-
def
|
76
|
-
|
76
|
+
def file_args_by_extension(file_args, extension)
|
77
|
+
if file_args.instance_of? Array
|
78
|
+
files_by_extension = file_args.group_by { |f| File.extname f }
|
79
|
+
args_to_string files_by_extension[extension]
|
80
|
+
else
|
81
|
+
args_to_string file_args
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def serve_jekyll(extra_args = '')
|
86
|
+
exec "#{JEKYLL_SERVE_CMD} #{args_to_string extra_args}"
|
87
|
+
end
|
88
|
+
|
89
|
+
def build_jekyll(extra_args = '')
|
90
|
+
exec_cmd "#{JEKYLL_BUILD_CMD} #{args_to_string extra_args}"
|
77
91
|
end
|
78
92
|
|
79
93
|
def git_sync_and_deploy(commands, branch: nil)
|
@@ -85,12 +99,11 @@ module GoScript
|
|
85
99
|
end
|
86
100
|
|
87
101
|
def lint_ruby(files)
|
88
|
-
files
|
89
|
-
exec_cmd "bundle exec rubocop #{files.join ' '}"
|
102
|
+
exec_cmd "bundle exec rubocop #{file_args_by_extension files, '.rb'}"
|
90
103
|
end
|
91
104
|
|
92
105
|
def lint_javascript(basedir, files)
|
93
|
-
files
|
94
|
-
exec_cmd "#{basedir}/node_modules/jshint/bin/jshint #{files
|
106
|
+
files = file_args_by_extension files, '.js'
|
107
|
+
exec_cmd "#{basedir}/node_modules/jshint/bin/jshint #{files}"
|
95
108
|
end
|
96
109
|
end
|
data/lib/go_script/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|