koboldy 0.2.6 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f5ba3590a17e2d4b4fea7445761a7d0937de2bb
4
- data.tar.gz: ef7cdb9b57654966b281ab339d705d5b2fa17978
3
+ metadata.gz: 45f0b792d3e7d2f1e98468f1952698e4d1a2f2c8
4
+ data.tar.gz: 45b26f94d1208b3a11f969ad4843348a80d54cb2
5
5
  SHA512:
6
- metadata.gz: d49bc83a6b80d3a2a616c164abf3efcb37831b65fcac0848a8d26f66b3033d01d448da6a4425e6f40fc4eec0924cd1f88929efe87e59f97b486bd4b55300ed0c
7
- data.tar.gz: 1f27d2d4702f769efc3491ccde3bb986087b8c6d2b8f72fee5c6265ded50a0ba093c13e159552d1e1255894bef1137bac014985eca700fb58ef8d024490e9a8a
6
+ metadata.gz: da0900a4adafb8a083cd59c26e20cd88ac93b27ef1d6f71b880051662a320668ca0e7df085da7bb882f85609ff83dcecba0e9e1e154a97bebf3e84600a06ef8d
7
+ data.tar.gz: 6c2f37ca7a96528504c8422b4ff6791197b682e41cf78b0ef48a2299367f23f27c208e97a2d19d18b915cd43d2e4802c2817c037b9c38e5e69a2a58835014afd
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1.4
5
5
  - 2.2.0
6
+ - 2.3.0
6
7
 
7
8
  sudo: false
8
9
  cache: bundler
@@ -2,3 +2,4 @@ require_relative "koboldy/version"
2
2
  require_relative "koboldy/conf"
3
3
  require_relative "koboldy/run"
4
4
  require_relative "koboldy/io"
5
+ require_relative "koboldy/validate"
@@ -0,0 +1,16 @@
1
+ class Koboldy
2
+ class NoJsModuleError < RuntimeError
3
+ end
4
+
5
+ module Command
6
+ def self.validate_installation_with_file(file)
7
+ result = File.read(file)
8
+ validate_installation result
9
+ end
10
+
11
+ def self.validate_installation(string)
12
+ raise ::Koboldy::NoJsModuleError, string unless string.scan(/Error: Cannot find module.*/).empty?
13
+ string
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  class Koboldy
2
- VERSION = "0.2.6"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -27,7 +27,7 @@ class TestKobold < Test::Unit::TestCase
27
27
  data( # on/off
28
28
  "test1" => [true],
29
29
  "test2" => [false])
30
- test "#add_hide_shift" do |(boolean)|
30
+ test "#add_hide_shift" do |boolean|
31
31
  @kobold.add_hide_shift boolean
32
32
  assert_equal(@kobold.config["hideShift"], boolean)
33
33
  end
@@ -36,7 +36,7 @@ class TestKobold < Test::Unit::TestCase
36
36
  data( # on/off
37
37
  "test1" => [true],
38
38
  "test2" => [false])
39
- test "#add_compose_left_to_right" do |(boolean)|
39
+ test "#add_compose_left_to_right" do |boolean|
40
40
  @kobold.add_compose_left_to_right boolean
41
41
  assert_equal(@kobold.config["composeLeftToRight"], boolean)
42
42
  end
@@ -0,0 +1,30 @@
1
+ require "test/unit"
2
+
3
+ require "./lib/koboldy/validate"
4
+
5
+ class ValidateTest < Test::Unit::TestCase
6
+ test "#validate_kobold_result is invalid" do
7
+ test_string =<<-EOS
8
+ module.js:340
9
+ throw err;
10
+ ^
11
+ Error: Cannot find module 'graceful-fs'
12
+ at Function.Module._resolveFilename (module.js:338:15)
13
+ at Function.Module._load (module.js:280:25)
14
+ at Module.require (module.js:364:17)
15
+ at require (module.js:380:17)
16
+ EOS
17
+
18
+ assert_raise(::Koboldy::NoJsModuleError) do
19
+ ::Koboldy::Command.validate_installation(test_string)
20
+ end
21
+ end
22
+
23
+ test "#validate_kobold_result is valid" do
24
+ test_string =<<-EOS
25
+ ok
26
+ EOS
27
+
28
+ assert_equal "ok\n", ::Koboldy::Command.validate_installation(test_string)
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koboldy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-15 00:00:00.000000000 Z
11
+ date: 2016-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -56,10 +56,12 @@ files:
56
56
  - lib/koboldy/conf.rb
57
57
  - lib/koboldy/io.rb
58
58
  - lib/koboldy/run.rb
59
+ - lib/koboldy/validate.rb
59
60
  - lib/koboldy/version.rb
60
61
  - test/data/kobold_test_data.txt
61
62
  - test/kobold/conf_test.rb
62
63
  - test/kobold/run_test.rb
64
+ - test/kobold/validate_test.rb
63
65
  - test/run_test.rb
64
66
  homepage: https://github.com/KazuCocoa/koboldy
65
67
  licenses:
@@ -81,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
83
  version: '0'
82
84
  requirements: []
83
85
  rubyforge_project:
84
- rubygems_version: 2.2.2
86
+ rubygems_version: 2.6.6
85
87
  signing_key:
86
88
  specification_version: 4
87
89
  summary: Support library for kobold which is nodejs app.
@@ -89,4 +91,5 @@ test_files:
89
91
  - test/data/kobold_test_data.txt
90
92
  - test/kobold/conf_test.rb
91
93
  - test/kobold/run_test.rb
94
+ - test/kobold/validate_test.rb
92
95
  - test/run_test.rb