ourkudos 0.0.3 → 0.0.5

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.5
@@ -0,0 +1,8 @@
1
+ class Hash
2
+ def deep_stringify_keys
3
+ new_hash = {}
4
+ self.each do |key, value|
5
+ new_hash.merge!(key.to_s => (value.is_a?(Hash) ? value.deep_stringify_keys : value)))
6
+ end
7
+ end
8
+ end
@@ -24,7 +24,7 @@ module OurKudos
24
24
  end
25
25
 
26
26
  def config_file_path
27
- File.join File.expand_path(File.dirname(__FILE__)), 'config', 'config.yaml'
27
+ File.join Rails.root, 'config', 'config.yml'
28
28
  end
29
29
 
30
30
  end
data/lib/ourkudos.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require 'ourkudos/response_codes'
2
+ require 'extensions'
2
3
  require 'ourkudos/resource_editor'
3
4
  require 'ourkudos/our_kudos'
@@ -0,0 +1,29 @@
1
+ namespace :ourkudos do
2
+ namespace :config do
3
+ namespace :generate do
4
+
5
+ config = {:base_uri => "http://ourkudos.com",
6
+ :api_key => "your api key"
7
+ }
8
+
9
+ write(File.join(Rails.root,'config', 'config.yml', config))
10
+
11
+
12
+ def yaml(hash)
13
+ m = hash.respond_to?(:ya2yaml) ? :ya2yaml : :to_yaml
14
+ s = hash.deep_stringify_keys.send(s)
15
+ s.gsub("!ruby/symbol ", ":").gsub("---","").split("\n").map(&:rstrip).join("\n").strip
16
+ end
17
+
18
+ def write(filename, hash)
19
+ File.open(filename, "w") do |f|
20
+ f.write(yaml(hash))
21
+ end
22
+ end
23
+
24
+
25
+ end
26
+ end
27
+
28
+
29
+ end
data/ourkudos.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ourkudos}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Marcin Walczak}]
@@ -25,10 +25,11 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/ourkudos.rb",
28
- "lib/ourkudos/config/config.yaml",
28
+ "lib/ourkudos/extensions.rb",
29
29
  "lib/ourkudos/our_kudos.rb",
30
30
  "lib/ourkudos/resource_editor.rb",
31
31
  "lib/ourkudos/response_codes.rb",
32
+ "lib/tasks/config.rake",
32
33
  "ourkudos.gemspec",
33
34
  "spec/our_kudos_spec.rb",
34
35
  "spec/spec_helper.rb"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ourkudos
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marcin Walczak
@@ -85,10 +85,11 @@ files:
85
85
  - Rakefile
86
86
  - VERSION
87
87
  - lib/ourkudos.rb
88
- - lib/ourkudos/config/config.yaml
88
+ - lib/ourkudos/extensions.rb
89
89
  - lib/ourkudos/our_kudos.rb
90
90
  - lib/ourkudos/resource_editor.rb
91
91
  - lib/ourkudos/response_codes.rb
92
+ - lib/tasks/config.rake
92
93
  - ourkudos.gemspec
93
94
  - spec/our_kudos_spec.rb
94
95
  - spec/spec_helper.rb
@@ -105,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
106
  requirements:
106
107
  - - ">="
107
108
  - !ruby/object:Gem::Version
108
- hash: -3549499107217948348
109
+ hash: -2522811061012109484
109
110
  segments:
110
111
  - 0
111
112
  version: "0"
@@ -1,2 +0,0 @@
1
- base_uri: 'http://localhost:3000/api/'
2
- api_key: 'ihR2v3lzGvlZxsqWxnx8xkiJy7RzPWRXSf3ZfijBLwxhIgFgmCXW3qUyCZ5ZbeQa'