tasc 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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjhiMDlmYTY4ODc1YTBiNzI5ZWI4OTllOWM1NmMxNjVhYTQzNTM2Ng==
4
+ NjQzYjFjODU1MzhmMmU1N2FlMTIzZGIwNmY5MjA0YTEyYzUyNjZiMQ==
5
5
  data.tar.gz: !binary |-
6
- ODU0ZjdiNWUwMTVlZjE0ZTljYzE1Mzg3YzBmNTUyNzliMmUyNWNlYw==
6
+ N2VmN2IxMDFmOTYxZjQ3ODQ2MDhjODgyNmFiMzVhYTcwZjcyOTc3Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2Q4YjBjOWQ3OTk5MGVlMWJjZDU0ZTg3MDljMjJhNGQ4M2Y0ZGE1NDMxYjU5
10
- ZTM5OGJjZmRjOThlYmJhYTFmYTY1YmQ2ZmQ2NmFmYWM0Y2YwNGJjYzZiMzQx
11
- MTM2MDk0Yjg2NzNkMjdhMWViMTA4NmE0ZDg4MGIzNDVlZDIxMmY=
9
+ MDU2MjdmODIxZmYyZGZhMzI3YTA3ZDhlMTY3ZGI1MGRjMDYyMTNlZmFhMTlk
10
+ NzBkZWJkN2RjNjE4NzQyNzk5OTNjNWNjOWIyNDEzZjc3ZjI1YzliMTNiZjc3
11
+ MmE3ODFkMDEzYmIxMzllMDA5NzQ4ZGRjMWVlZDBmYTU2Yjk3NTI=
12
12
  data.tar.gz: !binary |-
13
- NWRhMmY1ZTc2NzEyMzc2ZGVkODA0MWNiMzVlYmZlNzhlMWRlYWVjMzcyYThk
14
- MTQxN2JkYTA5YjMwNzhiMDgyYzM4N2ExYzg1ZmIwYTg0ZWVlNjVlYjEyYWRk
15
- NWUzOGViODU5ZDlmMjJiNjE5YWMzOWZhYzY3YzZjZDQ4OTk1ZGI=
13
+ ZDFhOTdlZDBkZDAxYWM3YmE5ZTVhM2JiYjIyNWJlYjNhMDQ4NTIxYjFhMzRj
14
+ NTI5OTlkNDEwNDZlZjJhZjcwZmQ3MmUxNmVhYjM1ZWMyYWQ5OWY2NGFmYWRi
15
+ OTI5YjE0NTI4NTMwMDAxNzUyYTAyOWU4NjU5NDE5NjdkYWZmNzE=
data/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # tasc CLI
2
- tasc is a command-line interface (CLI) for maintaining and managing the
3
- lists of terms that are available for auto-complete from the TrieService.
4
-
5
- tasc is a ruby gem built on top of the gli (aka, "git-like interface")
6
- library.
2
+ tasc (TrieService auto-suggest command-line interface) is a CLI for maintaining and managing the
3
+ lists of terms that are available for auto-complete.
7
4
 
8
5
  ### Installing
6
+
9
7
  $ gem install tasc
10
8
 
11
9
  Alternatively, clone this repo and execute the following commands from within this
12
10
  directory
11
+
13
12
  $ rake
14
13
  $ gem install tasc
15
14
 
@@ -21,7 +20,7 @@ started. To see all available commands simply type
21
20
 
22
21
  #### Client Configuration
23
22
  tasc will create a configuration file of servers you may connect to in
24
- your user directory under _.tasc/servers.yaml_. You can use the _config_
23
+ your user directory under _~/.tasc/servers.yaml_. You can use the _config_
25
24
  command to display your current config settings or alter them.
26
25
 
27
26
  $ tasc config
@@ -52,7 +51,7 @@ Supports 2 types of lists:
52
51
  Dynamic lists are self-maintaining. The TrieService keeps track of each
53
52
  entry's usage and age. You can configure a maximum number of entries
54
53
  that will be maintained. When the max size is reached, the usage and age is used to sort
55
- the list and remove the least-recently, least-frequently used item (LRLFU).
54
+ the list and remove the least-frequently used item (LFU).
56
55
 
57
56
  ### Building
58
57
 
@@ -11,8 +11,9 @@ command :list do |c|
11
11
  if resp.code == '200'
12
12
  puts "List of Labels:"
13
13
  entries = JSON resp.body
14
- entries.sort!.each do |e|
15
- puts " #{e}"
14
+ entries.keys.sort.each { |k| entries[k] = entries.delete k }
15
+ entries.each do |e|
16
+ puts " #{e[0]}:#{e[1]}"
16
17
  end
17
18
  else
18
19
  ap "Server Error: #{resp.code} - #{resp.message}"
@@ -11,7 +11,7 @@ command :show do |c|
11
11
  if resp.code == '200'
12
12
  entries = JSON resp.body
13
13
  puts "Entries from #{name}:"
14
- puts Hirb::Helpers::Table.render entries, :headers=>["Key", "Value", "Weight"]
14
+ puts Hirb::Helpers::Table.render entries, :headers=>["Key", "Value", "Weight", "Display"]
15
15
  elsif resp.code == '202'
16
16
  puts "List '#{name}' too long to display"
17
17
  elsif resp.code == '204'
@@ -1,21 +1,21 @@
1
1
  desc 'Updates an existing value on an entity list. If the value does not exist, it will be added.'
2
- long_desc '[name] [key] [value] [rank] are all required; e.g., tasc update state massachusetts MA 1'
2
+ long_desc '[name] [key] [value] [rank] [display] are all required; e.g., tasc update state massachusetts MA 1 Massachusetts'
3
3
 
4
4
  command :update do |c|
5
5
  c.action do |global_options,options,args|
6
6
 
7
7
  ap "Executing update command ..."
8
- if (args[0] == nil) || (args[1] == nil) || (args[2] == nil) || (args[3] == nil)
8
+ if (args[0] == nil) || (args[1] == nil) || (args[2] == nil) || (args[3] == nil) || (args[4] == nil)
9
9
  help_now! "Missing required arguments to update command."
10
10
  else
11
- if (args.length > 4)
11
+ if (args.length > 5)
12
12
  help_now! "Too many arguments given."
13
13
  else
14
- uristr = "http://#{$host}/typeahead/update?entity=#{args[0]}&key=#{args[1]}&value=#{args[2]}&rank=#{args[3]}"
14
+ uristr = "http://#{$host}/typeahead/update?entity=#{args[0]}&key=#{args[1]}&value=#{args[2]}&rank=#{args[3]}&display=#{args[4]}"
15
15
  uri = URI(uristr)
16
16
  resp = Net::HTTP.get_response(uri)
17
17
  if (resp.code == '200')
18
- ap "Added #{args[1]} to #{args[0]} with value #{args[2]} rank #{args[3]}"
18
+ ap "Added #{args[1]} to #{args[0]} with value #{args[2]} rank #{args[3]} display #{args[4]}"
19
19
  else
20
20
  ap "Server Error: #{resp.code} - #{resp.message}"
21
21
  ap "URI: #{uristr}"
@@ -1,4 +1,4 @@
1
1
  module Tasc
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  COMMENT = 'beta release'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tasc
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
  - Steve Quince
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-27 00:00:00.000000000 Z
11
+ date: 2013-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.0.2
179
+ rubygems_version: 2.0.3
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: TrieService Auto-Suggest Command-Line Client for managing term lists