git-feats 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.0.3 (2012-12-10)
2
+
3
+ * adds `update-feats` command
4
+ * modifies api key storage method
5
+
1
6
  ## 0.0.2 (2012-12-6)
2
7
 
3
8
  * fix API to "handle" request failures
data/lib/git-feats/api.rb CHANGED
@@ -6,7 +6,7 @@ module GitFeats
6
6
 
7
7
  extend self
8
8
 
9
- URL = 'http://gitfeats.com'
9
+ URL = 'http://www.gitfeats.com'
10
10
 
11
11
  def upload_feats
12
12
  # Post json to git-feats
@@ -38,8 +38,8 @@ module GitFeats
38
38
  # Construct the body for the upload feats post
39
39
  def upload_feats_body
40
40
  {
41
- :username => Config.username,
42
- :key => Config.api_key,
41
+ :username => Config.name,
42
+ :key => Config.key,
43
43
  :history => History.data
44
44
  }
45
45
  end
@@ -3,28 +3,22 @@ module GitFeats
3
3
 
4
4
  extend self
5
5
 
6
- CONFIG_CMD = "git config --global feats.key"
6
+ CONFIG_USER_CMD = "git config --global github.user"
7
+ CONFIG_KEY_CMD = "git config --global feats.key"
7
8
 
8
9
  # Returns the config value for username
9
- def username
10
- @username ||= config_value.split('-')[0]
10
+ def name
11
+ @name ||= `#{CONFIG_USER_CMD}`.chomp
11
12
  end
12
13
 
13
14
  # Returns the config value for api key
14
- def api_key
15
- @api_key ||= config_value.split('-')[1].chomp
15
+ def key
16
+ @key ||= `#{CONFIG_KEY_CMD}`.chomp
16
17
  end
17
18
 
18
19
  # Check if config exists and is configured properly
19
20
  def exists?
20
- username && api_key
21
- end
22
-
23
- private
24
-
25
- # loads the config value from the global git config file
26
- def config_value
27
- @config_value ||= `#{CONFIG_CMD}`
21
+ name && key
28
22
  end
29
23
  end
30
24
  end
@@ -148,8 +148,8 @@
148
148
  :count: 1
149
149
 
150
150
  "pull":
151
- :assimilation:
152
- :name: "Assimilation"
151
+ :archer:
152
+ :name: "Archer"
153
153
  :desc: "Fetched from and merged with another repository with git pull"
154
154
  :count: 1
155
155
 
@@ -244,8 +244,8 @@
244
244
  :count: 1
245
245
 
246
246
  "whatchanged":
247
- :historian:
248
- :name: "Historian"
247
+ :forgetful:
248
+ :name: "Forgetful"
249
249
  :desc: "Showed the difference each commit introduced with git whatchanged"
250
250
  :count: 1
251
251
  ---
@@ -17,7 +17,15 @@ module GitFeats
17
17
 
18
18
  # Execute git command
19
19
  def run
20
- exec(*@args.to_exec)
20
+ puts @args[0]
21
+ case @args[0]
22
+ when "update-feats"
23
+ if Config.exists?
24
+ API.upload_feats
25
+ end
26
+ else
27
+ exec(*@args.to_exec)
28
+ end
21
29
  end
22
30
  end
23
31
  end
@@ -1,3 +1,3 @@
1
1
  module GitFeats
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-feats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-07 00:00:00.000000000 Z
12
+ date: 2012-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json