gitdis 0.0.1.1 → 0.0.2.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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -24
  3. data/VERSION +1 -1
  4. data/bin/gitdis +3 -2
  5. data/lib/gitdis.rb +1 -2
  6. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbc3764ebe71bcc03b916fb6a29b1b02daaf34dd
4
- data.tar.gz: 3dbd971bf31a576d535e176e573023fe362d383b
3
+ metadata.gz: beade5f09d9ae75291929512a0167b15ed6d5ea3
4
+ data.tar.gz: 78f1b0232a334dc7f39d080ec33876950f31e83e
5
5
  SHA512:
6
- metadata.gz: 6da95b9acf0be41a12e4c588169d19ab10e72d48f381f4337fe229e166263b79d414be8cb2144cef37d6a9668de6771355bdf1ca1e28be4268372db013a26421
7
- data.tar.gz: 64f87929af5d569b59bf08d2d927855ee657508fed9bd149ab37a577852062dfc4c8d94dfb972914a40fd032243298b6f21600088effeec78273d0f478700861
6
+ metadata.gz: 2d481b7509a15999e8a0ccf734b30c24941f775d2c7670b8ae4bcf384f6ce578165ff585cce365eb3b579859d9636e6fa443f55811e19222b158ebc78a9c673e
7
+ data.tar.gz: b875da553b25546d218218a09fa8385e64d0321ecf2e1cd11effe15a317aff7896abe295c4fd200f17477bc62063018589f71021ce3f374fa6d05f317f894c80
data/README.md CHANGED
@@ -18,40 +18,38 @@
18
18
 
19
19
  ### YAML Config
20
20
 
21
- 5 options, 1 keymap, plus environment overrides:
21
+ Toplevel keys are environments. `default` is required. Other environment
22
+ settings override defaults. 5 options, 1 keymap.
22
23
 
23
24
  ```
24
- redis-host: localhost
25
- redis-port: 6379
26
- redis-db: 0
27
- git-repo: ~/foo/bar/baz
28
- git-branch: quux
29
- keymap:
30
- "redis:key:1": "path/to/file1"
31
- "redis:key:2": "path/to/file2"
32
-
33
- environments:
34
- yours:
35
- redis-host: localhost
36
- git-branch: mine
37
- mine:
38
- redis-host: localhost
39
- git-branch: yours
40
- qa:
41
- redis-host: qa.big.com
42
- git-branch: develop
43
- prod:
44
- redis-host: secret.big.net
45
- git-branch: master
25
+ default:
26
+ redis-host: localhost
27
+ redis-port: 6379
28
+ redis-db: 0
29
+ git-repo: ~/foo/bar/baz
30
+ git-branch: quux
31
+ keymap:
32
+ "redis:key:1": "path/to/file1"
33
+ "redis:key:2": "path/to/file2"
34
+
35
+ qa:
36
+ redis-host: qa.big.com
37
+ git-branch: develop
38
+
39
+ prod:
40
+ redis-host: secret.big.net
41
+ git-branch: master
46
42
  ```
47
43
 
44
+ See also https://github.com/rickhull/gitdis/tree/master/examples
45
+
48
46
  ### Command Line Options
49
47
 
50
48
  Select your environment (optional). Add final overrides (optional).
51
49
 
52
50
  ```
53
51
  Environment selection
54
- -e, --environment select within YAML[environments]
52
+ -e, --environment toplevel YAML key
55
53
  Redis overrides
56
54
  -H, --redis-host string
57
55
  -p, --redis-port number
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1.1
1
+ 0.0.2.1
data/bin/gitdis CHANGED
@@ -7,7 +7,7 @@ require 'gitdis'
7
7
  opts = Slop.parse { |o|
8
8
  o.banner = "USAGE: gitdis path/to/config.yaml [options]"
9
9
  o.separator ' Environment selection'
10
- o.string '-e', '--environment', 'select within YAML[environments]'
10
+ o.string '-e', '--environment', 'toplevel YAML key'
11
11
  o.separator ' Redis overrides'
12
12
  o.string '-H', '--redis-host', 'string'
13
13
  o.integer '-p', '--redis-port', 'number'
@@ -66,12 +66,13 @@ redis_options = {}
66
66
  }
67
67
  puts "Redis options: #{redis_options}"
68
68
 
69
- # do things'n'stuff
69
+ # process keymap
70
70
  if opts.dump?
71
71
  GitDis.dump(keymap.keys, redis_options)
72
72
  else
73
73
  gd = GitDis.new config.fetch('git-repo')
74
74
  gd.git_pull config.fetch('git-branch')
75
+
75
76
  keymap.each { |key, fileglob|
76
77
  result = gd.update(key, fileglob)
77
78
  case result
data/lib/gitdis.rb CHANGED
@@ -42,11 +42,10 @@ class GitDis
42
42
  val = redis.get(rkey)
43
43
  if val and val.include?("\n")
44
44
  val = "\n" << val.split("\n").map { |line| "\t#{line}" }.join("\n")
45
+ puts ["[#{rkey}]", val].join(' ')
45
46
  end
46
- puts ["[#{rkey}]", val].join(' ')
47
47
  }
48
48
  }
49
- redis.disconnect
50
49
  end
51
50
 
52
51
  attr_accessor :repo_dir, :redis
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitdis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull