ruby_pocket 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f563c1c1e135a1c47d268ecfdb1756b725024d90
4
- data.tar.gz: d0d152035dcbd56324cc78c95b6c67595f8449ea
3
+ metadata.gz: 837ddac93df693f41227f1af739112efb5c88cda
4
+ data.tar.gz: 09013cc6c66ec02fcfeb346a5e2fcf21013d1617
5
5
  SHA512:
6
- metadata.gz: c51b5f705315b878fccc9791acf391e57e5f916eefb71fd2f6b8af84a6d77e1419d4d7d78dbca4c660f2e21b4a05479808c1af0896539ac282b6ae735f0e996c
7
- data.tar.gz: 550e7671b2f70a3a98e5f307f90b12451b1b6df892711fae04941e4026a7d4876ff91dd895fedf81c52a6bf027d44f07540902537d39fcc33dca0840465f9bc5
6
+ metadata.gz: 0f31451b1469e635bf20d73ac097c5393cbf30b4da3153f0683d153000401e198ef9cc73af0a8d25d7a7cf28684baace1a0e26f6544af1f8de48fd1a1edc1153
7
+ data.tar.gz: 1999dbecb84104b1d7542dd131f28aa2805139f97022c7aff467b73f5d2a0d49958423ad1bd8cafa2eb20fbf2c9880c3996dbbf62204164764ac7693fad9a01a
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Ruby Pocket
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/ruby_pocket.png)](http://badge.fury.io/rb/ruby_pocket)
3
4
  [![Code Climate](https://codeclimate.com/github/thiagoa/ruby_pocket/badges/gpa.svg)](https://codeclimate.com/github/thiagoa/ruby_pocket)
4
5
  [![Test Coverage](https://codeclimate.com/github/thiagoa/ruby_pocket/badges/coverage.svg)](https://codeclimate.com/github/thiagoa/ruby_pocket/coverage)
5
6
  [![Travis CI](https://travis-ci.org/thiagoa/ruby_pocket.svg)](https://travis-ci.org/thiagoa/ruby_pocket)
@@ -49,13 +50,14 @@ Currently the app has a very simple feature set:
49
50
 
50
51
  ## How to install
51
52
 
52
- There is no RubyGem yet. Just clone the repo and install the dependencies:
53
+ Install the gem:
53
54
 
54
55
  ```sh
55
- bundle install
56
+ gem install ruby_pocket
56
57
  ```
57
58
 
58
- The binary is located in `bin/pocket`.
59
+ If you want to do development on this gem, clone the repo and run `bundle
60
+ install`.
59
61
 
60
62
  ## Usage
61
63
 
@@ -77,7 +79,7 @@ Favorite 'jlevy/the-art-of-command-line · GitHub' created!
77
79
  Add a favorite, but specify its name:
78
80
 
79
81
  ```sh
80
- $ pocket -a https://github.com/jlevy/the-art-of-command-line -t 'The Art of Command Line'
82
+ $ pocket -a https://github.com/jlevy/the-art-of-command-line -n 'The Art of Command Line'
81
83
 
82
84
  Favorite 'The Art of Command Line' created!
83
85
  ```
data/bin/pocket ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+
5
+ $LOAD_PATH << Pathname(__dir__).join('..', 'config')
6
+ $LOAD_PATH << Pathname(__dir__).join('..', 'lib')
7
+
8
+ require 'optparse'
9
+ require 'ruby_pocket'
10
+ require 'config'
11
+ require 'ruby_pocket/all'
12
+
13
+ include RubyPocket
14
+
15
+ options = Cli::Options.new
16
+
17
+ option_parser = OptionParser.new do |opts|
18
+ opts.banner = <<-HEADER
19
+ Ruby Pocket - A warm place to store your precious development references
20
+
21
+ Usage: #{File.basename($PROGRAM_NAME)} [action] [options]
22
+ HEADER
23
+
24
+ opts.separator ""
25
+ opts.separator "Available actions:"
26
+ opts.separator ""
27
+
28
+ opts.on('-a URL', '--add URL', 'Add a favorite by URL') do |url|
29
+ options.action = :add
30
+ options.values[:url] = url
31
+ end
32
+
33
+ opts.on('-l', '--list', 'List available favorites') do
34
+ options.action = :list
35
+ end
36
+
37
+ opts.on('-d ID', '--delete ID', Array, 'Delete a favorite') do |ids|
38
+ options.action = :delete
39
+ options.values[:ids] = ids.map(&:to_i)
40
+ end
41
+
42
+ opts.on('-o ID', '--open ID', Integer, 'Open a favorite on the browser') do |id|
43
+ options.action = :open
44
+ options.values[:id] = id
45
+ end
46
+
47
+ opts.separator ""
48
+ opts.separator "Optional available flags:"
49
+ opts.separator ""
50
+
51
+ opts.on('-n NAME', '--name NAME', 'Favorite name') do |name|
52
+ options.values[:name] = name
53
+ end
54
+
55
+ opts.on('-t TAGS', '--tag TAGS', Array, 'Comma-separated tags') do |tags|
56
+ options.values[:tag_names] = tags
57
+ end
58
+ end
59
+
60
+ begin
61
+ option_parser.parse!
62
+ options.validate!
63
+
64
+ Cli.dispatch options
65
+ rescue ArgumentError, OptionParser::ParseError, RubyPocketError => e
66
+ abort "Error: #{e.message}"
67
+ end
data/db/pocket_test.db CHANGED
Binary file
@@ -1,3 +1,3 @@
1
1
  module RubyPocket
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_pocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago A. Silva
@@ -213,13 +213,15 @@ dependencies:
213
213
  description: A command line client to store and manage development favorites
214
214
  email:
215
215
  - thiagoaraujos@gmail.com
216
- executables: []
216
+ executables:
217
+ - pocket
217
218
  extensions: []
218
219
  extra_rdoc_files: []
219
220
  files:
220
221
  - MIT-LICENSE
221
222
  - README.md
222
223
  - Rakefile
224
+ - bin/pocket
223
225
  - config/config.rb
224
226
  - config/database.rb
225
227
  - db/migrations/001_create_tags.rb