ddbcli 0.1.9 → 0.2.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.
data/bin/ddbcli CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
3
3
 
4
- Version = '0.1.9'
4
+ Version = '0.2.0'
5
5
 
6
6
  HISTORY_FILE = File.join((ENV['HOME'] || ENV['USERPROFILE'] || '.'), '.ddbcli_history')
7
7
  HISTSIZE = 500
@@ -1,5 +1,7 @@
1
+ require 'tempfile'
2
+
1
3
  def print_help
2
- puts <<'EOS'
4
+ doc =<<EOS
3
5
  ##### Query #####
4
6
 
5
7
  SHOW TABLES
@@ -126,4 +128,13 @@ Shell
126
128
  .version displays a version
127
129
 
128
130
  EOS
131
+
132
+ Tempfile.open("ddbcli.#{$$}.#{Time.now.to_i}") do |f|
133
+ f.puts(doc)
134
+ f.flush
135
+
136
+ unless system("less #{f.path}")
137
+ puts doc
138
+ end
139
+ end
129
140
  end
@@ -1,13 +1,18 @@
1
+ require 'base64'
2
+
1
3
  module DynamoDB
2
4
  class Binary
3
- attr_reader :value
4
- alias to_s value
5
- alias to_str value
6
-
7
5
  def initialize(value)
8
6
  @value = value
9
7
  end
10
8
 
9
+ def value
10
+ Base64.encode64(@value).delete("\n")
11
+ end
12
+
13
+ alias to_s value
14
+ alias to_str value
15
+
11
16
  def inspect
12
17
  @value.inspect
13
18
  end
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.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: