gist_directory 0.0.1 → 0.0.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: d1422f15dc239a5d7c48b8e3bdd209d0795c0295
4
- data.tar.gz: 2e5680ae30af48b17e1a21df8af29954f4e13c51
3
+ metadata.gz: fcc8a86291cbd612480beb4d2e3924db5ef7e901
4
+ data.tar.gz: 96ff47c6bac9340cfe43bab4bd501c27207727b9
5
5
  SHA512:
6
- metadata.gz: 56ed10a967e084f1e7de289608b48cc529816e9093a6586c7d36cb88845d7f6233b3de11bd67d1891119bfd51aeca45a05ad72073275b6108b5827244eed6f00
7
- data.tar.gz: 187ecee0af3c0319f5f27cf81d45fd094a34c7fc990558f379d526444faa5b6f774c93ad097bd4be330c0b4853cc583c94508fcc0bda24d1b6d7026fa2b4de13
6
+ metadata.gz: efdafd6a2f7cbca9547c4730edbb841f1fff751969d0bbfc17a2353fe62e6fbbaf2bce6fe70c715208134611cfbec27536d9f65c1ccc5e89a26fc37784f35526
7
+ data.tar.gz: 144b13f5cf3b4cca68082800745628b4c324d3a74e1ee4f52282d012c779f907d364457dc9a518a2ba505f21ba095890f7872ec78e16ac519738a9a73e40e026
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  /Gemfile.lock
2
+ /pkg/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gist_directory
2
2
 
3
- Create collections of gists in a local directory
3
+ Create collections of public gists in a local directory
4
4
 
5
5
  # Usage
6
6
 
@@ -8,11 +8,11 @@ Create a gist called `food.md` in a directory called `food`
8
8
  under your home directory:
9
9
 
10
10
  ```shell
11
- gist_directory ~/food
11
+ gist_directory create ~/food
12
12
  ```
13
13
 
14
14
  Create a gist called `bacon.txt`:
15
15
 
16
16
  ```shell
17
- gist_directory ~/food bacon.txt
17
+ gist_directory create ~/food bacon.txt
18
18
  ```
data/bin/gist_directory CHANGED
@@ -6,9 +6,9 @@ require "gist_directory"
6
6
 
7
7
  def usage
8
8
  puts <<-EOT
9
- #{$0} DIRECTORY [FILE]"
9
+ #{$0} create DIRECTORY [FILE]"
10
10
 
11
- PATH:
11
+ DIRECTORY:
12
12
  Creates a Gist with a single file.
13
13
 
14
14
  FILE:
@@ -18,13 +18,16 @@ Supply an optional filename to use instead of this default.
18
18
  EOT
19
19
  end
20
20
 
21
- if ARGV.size == 0
21
+ if ARGV.size < 2
22
22
  usage
23
23
  exit 0
24
24
  end
25
25
 
26
- path = ARGV[0]
26
+ command = ARGV[0]
27
+ path = ARGV[1]
27
28
  directory = File.basename(path)
28
- file = ARGV[1] || directory + ".md"
29
+ file = ARGV[2] || directory + ".md"
30
+
31
+ raise "Unknown command '#{command}'" nless command == "create"
29
32
 
30
33
  GistDirectory.new(path: path).create(filename: file)
@@ -4,7 +4,7 @@ require "git"
4
4
  class GistDirectory
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- REVISION = 1
7
+ REVISION = 2
8
8
  VERSION = [MAJOR, MINOR, REVISION].map(&:to_s).join('.')
9
9
 
10
10
  attr_reader :path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gist_directory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates