ddbcli 0.3.4 → 0.3.5

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: 26219416d2ea4b38c6f0c1dedbc28d56567012c4
4
- data.tar.gz: 887316ac93a1ec3b6d8e831097e10e82efcc44ad
3
+ metadata.gz: 989847bbd044a7f8b55277fcf79d6f87497ce6dc
4
+ data.tar.gz: ebd92af86e25aa7f696851966c09ff62706f0667
5
5
  SHA512:
6
- metadata.gz: 0f95039b6a862fab4bf2851ed86609eda079a1ec9bbf7ac2daaaa7ccf27944ba1a8a754dd8572fa11d5a5ed0b4b2727934290f1697aa175521907dfe76054f37
7
- data.tar.gz: cf183b55cfc9fc1bc091dd9ab63efc0df893e30ee4a01fbbe8d8f98405083d99bb1bc9bd9f6517c7b72d4b28cf06829586e7c1a0a022bdd548cedd535db37021
6
+ metadata.gz: fd546866388539e3f4881b098c734fffe1c9c6237de8f6edb28164d9007d3bcd00d088457ae3100fc4c49b92d11a9c6e40785aa27586a2e4db24bc9a918707d8
7
+ data.tar.gz: cd554bcd559c6d3e396d43e754844412e421d02f23e21e071fec7df14a8e476e470b9958e4c1c492329d37437b276c3c063dbed2d9463954b27d8cf4e1181bfb
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ddbcli is an interactive command-line client of Amazon DynamoDB.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/ddbcli.png)](http://badge.fury.io/rb/ddbcli)
5
6
  [![Build Status](https://drone.io/bitbucket.org/winebarrel/ddbcli/status.png)](https://drone.io/bitbucket.org/winebarrel/ddbcli/latest)
6
7
 
7
8
  ## Installation
@@ -10,11 +11,11 @@ ddbcli is an interactive command-line client of Amazon DynamoDB.
10
11
 
11
12
  If you are not using RubyGems, you can use the script files that depend on only Ruby.
12
13
 
13
- [ddbcli-0.3.4](https://bitbucket.org/winebarrel/ddbcli/downloads/ddbcli-0.3.4)
14
+ [ddbcli-0.3.5](https://bitbucket.org/winebarrel/ddbcli/downloads/ddbcli-0.3.5)
14
15
 
15
16
  ```sh
16
- wget https://bitbucket.org/winebarrel/ddbcli/downloads/ddbcli-0.3.4
17
- sudo cp ddbcli-0.3.4 /usr/local/bin/ddbcli
17
+ wget https://bitbucket.org/winebarrel/ddbcli/downloads/ddbcli-0.3.5
18
+ sudo cp ddbcli-0.3.5 /usr/local/bin/ddbcli
18
19
  sudo chmod 755 /usr/local/bin/ddbcli
19
20
  ```
20
21
 
@@ -41,10 +42,29 @@ ddbcli # show prompt
41
42
 
42
43
  ![ddbcli demo](https://bitbucket.org/winebarrel/ddbcli/downloads/ddbcli-demo.gif)
43
44
 
45
+ ## GROUP BY (Aggregate)
46
+
47
+ ```
48
+ ap-northeast-1> select all gender from employees
49
+ -> where birth_date begins_with '1960'
50
+ -> | group_by(:gender) {|i| puts "DEBUG: 'i' contains: #{i[0, 3].inspect} ..."\; i.length };
51
+ DEBUG: 'i' contains: [{"gender"=>"M"}, {"gender"=>"M"}, {"gender"=>"M"}] ...
52
+ DEBUG: 'i' contains: [{"gender"=>"F"}, {"gender"=>"F"}, {"gender"=>"F"}] ...
53
+ {
54
+ "M": 546,
55
+ "F": 355
56
+ }
57
+ // 2 rows in set (0.20 sec)
58
+ ```
59
+
44
60
  ## Use Global Secondary Indexes
45
61
 
46
62
  * [https://gist.github.com/winebarrel/7938971](https://gist.github.com/winebarrel/7938971)
47
63
 
64
+ ## Enabling ctrl-r (reverse-search-history) on OS X
65
+
66
+ $ echo 'bind "^R" em-inc-search-prev' >> ~/.editrc
67
+
48
68
  ## Help
49
69
 
50
70
  ```
data/Rakefile CHANGED
@@ -2,4 +2,11 @@ require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new('spec')
5
+
5
6
  task :default => :spec
7
+
8
+ task :build => :pack_scripts
9
+
10
+ task :pack_scripts do
11
+ system(File.dirname(__FILE__) + '/etc/pack_to_one_script.rb')
12
+ end
data/bin/ddbcli CHANGED
@@ -59,6 +59,16 @@ else
59
59
  end
60
60
 
61
61
  # interactive mode
62
+ Readline.completion_proc = lambda do |word|
63
+ complete_words = DynamoDB::Parser::KEYWORDS.grep(/\A#{Regexp.quote word}/i)
64
+
65
+ if word.gsub(/[^a-z]+/i, '') =~ /[a-z]+/
66
+ complete_words = complete_words.map {|i| i.downcase }
67
+ end
68
+
69
+ complete_words
70
+ end
71
+
62
72
  src = ''
63
73
  prompt1 = lambda { "#{driver.region || 'unknown'}> " }
64
74
  prompt2 = lambda { "#{' ' * (prompt1.call.length - 3)}-> " }
@@ -4,7 +4,7 @@ require 'fileutils'
4
4
  require 'pathname'
5
5
  require 'stringio'
6
6
 
7
- ROOT_DIR = Pathname.new(__FILE__).join('..').expand_path
7
+ ROOT_DIR = Pathname.new(__FILE__).dirname.join('..').expand_path
8
8
  LIB_DIR = ROOT_DIR.join('lib')
9
9
 
10
10
  require LIB_DIR.join('ddbcli/version')
@@ -61,6 +61,8 @@ end
61
61
  ddbcli_buf = StringIO.new
62
62
  recursive_print('ddbcli.rb', 'ddbcli', LIB_DIR, ddbcli_buf)
63
63
 
64
+ FileUtils.mkdir_p(ROOT_DIR.join(DEST_FILE).dirname)
65
+
64
66
  ROOT_DIR.join(DEST_FILE).open('wb', 0755) do |f|
65
67
  f.puts '#!/usr/bin/env ruby'
66
68
  f.puts json_buf.string
@@ -1,5 +1,5 @@
1
1
  module DynamoDB
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
4
4
 
5
5
  Version = DynamoDB::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - bin/ddbcli
83
83
  - ddbcli.gemspec
84
+ - etc/pack_to_one_script.rb
84
85
  - lib/ddbcli.rb
85
86
  - lib/ddbcli/cli/evaluate.rb
86
87
  - lib/ddbcli/cli/functions.rb
@@ -96,7 +97,6 @@ files:
96
97
  - lib/ddbcli/ddb-parser.y
97
98
  - lib/ddbcli/ddb-rubyext.rb
98
99
  - lib/ddbcli/version.rb
99
- - pack_to_one_script.rb
100
100
  - spec/ddbcli_spec.rb
101
101
  - spec/delete_spec.rb
102
102
  - spec/insert_spec.rb