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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f496bded6c9673222755b3041dba2248c74a1b8f
4
- data.tar.gz: f9181e7c59e91011b17a3d05b4ea241f254a0a0a
3
+ metadata.gz: f06c78febb64d1a7e1e56f643e356b22a835ce58
4
+ data.tar.gz: 33df78ea5db8e6e78f4ce4fb7497521392f0eb2b
5
5
  SHA512:
6
- metadata.gz: 1c69760ad3ab8269f1f61204e9291d275b4cd07f737d3962f77e5f193bfd570d093d5dcbfb509d64520c31a2c9f5b1b19d7d87fbab6c6d562f869721a1e2f717
7
- data.tar.gz: cc918316e22269bca1e7a1a527464999bad3a6fafda21cd50eeaeddabcb0fddb9e92b05acf80cd8bb18c6a7fa468ae8893e4095483a4a33bcbaa34494b56d267
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 serve_jekyll(extra_args)
72
- exec "#{JEKYLL_SERVE_CMD} #{extra_args}"
71
+ def args_to_string(args)
72
+ args ||= ''
73
+ (args.instance_of? Array) ? args.join(' ') : args
73
74
  end
74
75
 
75
- def build_jekyll(extra_args)
76
- exec_cmd "#{JEKYLL_BUILD_CMD} #{extra_args}"
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.join ' '}"
106
+ files = file_args_by_extension files, '.js'
107
+ exec_cmd "#{basedir}/node_modules/jshint/bin/jshint #{files}"
95
108
  end
96
109
  end
@@ -1,7 +1,7 @@
1
1
  # @author Mike Bland (michael.bland@gsa.gov)
2
2
 
3
3
  module GoScript
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
 
6
6
  class Version
7
7
  def self.check_ruby_version(min_version)
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.0
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-24 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler