krl 0.1.55 → 0.1.56

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.
Files changed (4) hide show
  1. data/bin/krl +1 -1
  2. data/lib/check.rb +6 -2
  3. data/lib/help.rb +4 -0
  4. metadata +5 -5
data/bin/krl CHANGED
@@ -14,7 +14,7 @@ COMMANDS = {
14
14
  "commit" => lambda { |args| require LIB_DIR + 'commit'; KRL_CMD::Commit.go },
15
15
  "show" => lambda { |args| require LIB_DIR + 'show'; KRL_CMD::Show.go(args) },
16
16
  "note" => lambda { |args| require LIB_DIR + 'note'; KRL_CMD::Note.go(args) },
17
- "check" => lambda { |args| require LIB_DIR + 'check'; KRL_CMD::Check.go },
17
+ "check" => lambda { |args| require LIB_DIR + 'check'; KRL_CMD::Check.go(args) },
18
18
  "generate" => lambda { |args| require LIB_DIR + 'generate'; KRL_CMD::Generate.go(args) },
19
19
  "test" => lambda { |args| require LIB_DIR + 'test'; KRL_CMD::Test.go(args) },
20
20
  "info" => lambda { |args| require LIB_DIR + 'info'; KRL_CMD::Info.go(args) }
data/lib/check.rb CHANGED
@@ -1,12 +1,16 @@
1
1
  module KRL_CMD
2
2
  class Check
3
- def self.go
3
+ def self.go(args)
4
4
  require LIB_DIR + 'common'
5
5
  require 'json'
6
6
  app = KRL_COMMON::get_app
7
7
  krl_file = File.join(Dir.pwd, app.application_id + ".krl")
8
8
  raise "Cannot find .krl file." unless File.exists?(krl_file)
9
- apiurl = "http://krl.kobj.net/manage/parse/ruleset"
9
+ if args.to_s != ""
10
+ apiurl = "http://krl.kobj.net/manage/parse/ruleset"
11
+ else
12
+ apiurl = args.to_s
13
+ end
10
14
  apiargs = { "krl" => File.open(krl_file, 'r') { |f| f.read } }
11
15
  validateresponse = Net::HTTP.post_form(URI.parse(apiurl), apiargs).body.to_s
12
16
  jdata = JSON.parse(validateresponse, { :max_nesting => false })
data/lib/help.rb CHANGED
@@ -65,6 +65,10 @@ module KRL_CMD
65
65
  puts " ".ljust(20) + "bookmarklet runtime(optional)"
66
66
  puts " ".ljust(20) + "infocard name datasets(optional)"
67
67
  puts "check".ljust(20) + "Performs a syntax check of your .krl file."
68
+ puts " ".ljust(20) + "The location of the parser can also be added"
69
+ puts " ".ljust(20) + "as an optional argument."
70
+ puts " ".ljust(20) + "Example: krl check"
71
+ puts " ".ljust(20) + "or: krl check http://0.0.0.0/manage/parse/ruleset"
68
72
  puts
69
73
  end
70
74
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 55
9
- version: 0.1.55
8
+ - 56
9
+ version: 0.1.56
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Farmer, Cid Dennis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-19 00:00:00 -06:00
17
+ date: 2010-05-25 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +27,8 @@ dependencies:
27
27
  segments:
28
28
  - 0
29
29
  - 1
30
- - 2
31
- version: 0.1.2
30
+ - 26
31
+ version: 0.1.26
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency