edm 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Rakefile +1 -0
  2. data/edm.gemspec +1 -0
  3. data/lib/edm/version.rb +1 -1
  4. data/lib/edm.rb +3 -4
  5. metadata +13 -2
data/Rakefile CHANGED
@@ -1 +1,2 @@
1
1
  require "bundler/gem_tasks"
2
+
data/edm.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = ""
11
11
  s.summary = %q{edm api package}
12
12
  s.description = %q{demohour edm api}
13
+ s.add_development_dependency 'spec'
13
14
 
14
15
  s.rubyforge_project = "edm"
15
16
 
data/lib/edm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Edm
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/edm.rb CHANGED
@@ -1,14 +1,13 @@
1
1
  require "edm/version"
2
2
 
3
3
  module Edm
4
- KEY = Setting.edm_key
5
- def self.batch_create_contacts(options = {})
6
- sign = generate_sign(options)
4
+ def self.batch_create_contacts(key, options = {})
5
+ sign = generate_sign(key, options)
7
6
  options["sign"] = sign
8
7
  result = remote_request('post', 'http://0.0.0.0:3000/api/contacts/batch_create.json', options)
9
8
  end
10
9
 
11
- def self.generate_sign(options = {})
10
+ def self.generate_sign(key, options = {})
12
11
  if options.length > 0
13
12
  options.to_a.sort.map { |c| "#{c[0]}=#{c[1]}" }.join('&')
14
13
  sign = Digest::SHA1.hexdigest("#{str}#{key}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,18 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2011-12-30 00:00:00.000000000Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: spec
16
+ requirement: &70203233039780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70203233039780
14
25
  description: demohour edm api
15
26
  email:
16
27
  - lijiping@demohour.com