iprocessor 0.0.1 → 0.0.2

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.
@@ -1,21 +1,27 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'iprocessor/version'
6
+ require 'iprocessor/conf'
5
7
 
6
8
  Gem::Specification.new do |gem|
7
9
  gem.name = "iprocessor"
8
10
  gem.version = Iprocessor::VERSION
9
- gem.authors = ["Moin Haidar"]
10
- gem.email = ["moinhaidar@gmail.com"]
11
- gem.description = %q{Image Processor}
12
- gem.summary = %q{Image Processor}
13
- gem.homepage = ""
11
+ gem.authors = ['Moin Haidar']
12
+ gem.email = ['moinhaidar@gmail.com']
13
+ gem.description = %q{ Ruby Wrapper for Card Reader API }
14
+ gem.summary = %q{ Ruby Wrapper for Card Reader API }
15
+ gem.homepage = ''
14
16
 
17
+ # ensures that any files tracked in the git repo will be included.
15
18
  gem.files = `git ls-files`.split($/)
16
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ #Files that are used for testing the gem. Supports TestUnit, MiniTest, RSpec, and Cucumber
17
21
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
19
-
22
+ #Directories within the gem that need to be loaded in order to load the gem.
23
+ gem.require_paths = ['lib']
24
+ #Specify any dependencies here
20
25
  gem.add_dependency 'httparty'
26
+
21
27
  end
@@ -1,4 +1,6 @@
1
- require "iprocessor/version"
1
+ require 'iprocessor/version'
2
+ require 'iprocessor/conf'
3
+ require 'httparty'
2
4
 
3
5
  module Iprocessor
4
6
 
@@ -8,22 +10,27 @@ module Iprocessor
8
10
 
9
11
  format :json
10
12
  headers 'ContentType' => "application/octet-stream; charset=utf-8;"
11
- attr_accessor :base_url
13
+ #attr_accessor :base_url
12
14
 
13
15
  def initialize(username, password)
14
16
  @auth = {:username => username, :password => password}
15
- @base_url = 'http://cloudsdk.card-reader.com/CSSNService/CardProcessor/'
17
+ @base_url = Iprocessor::BASE_URL
16
18
  end
17
19
 
18
- def read_license(img_byte, api, filter)
20
+ def read_license(img_byte, action, filter)
19
21
  options = {:body => img_byte, :basic_auth => @auth}
20
- url = @base_url + api + optionize(filter)
22
+ url = @base_url + clean(action) + optionize(filter)
21
23
  self.class.post(url, options)
22
24
  end
23
25
 
24
26
  def optionize(filter)
25
27
  filter.join('/')
26
28
  end
29
+
30
+ def clean(action)
31
+ action.present? ? (action.chomp.gsub('/', '').insert(0,'/').insert(-1,'/')) : ''
32
+ end
33
+
27
34
  end
28
35
 
29
36
  end
@@ -0,0 +1,3 @@
1
+ module Iprocessor
2
+ BASE_URL = 'http://cloudsdk.card-reader.com/CSSNService/CardProcessor'
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Iprocessor
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iprocessor
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:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-26 00:00:00.000000000 Z
12
+ date: 2013-03-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -27,7 +27,7 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- description: Image Processor
30
+ description: ! ' Ruby Wrapper for Card Reader API '
31
31
  email:
32
32
  - moinhaidar@gmail.com
33
33
  executables: []
@@ -41,6 +41,7 @@ files:
41
41
  - Rakefile
42
42
  - iprocessor.gemspec
43
43
  - lib/iprocessor.rb
44
+ - lib/iprocessor/conf.rb
44
45
  - lib/iprocessor/version.rb
45
46
  homepage: ''
46
47
  licenses: []
@@ -65,5 +66,5 @@ rubyforge_project:
65
66
  rubygems_version: 1.8.25
66
67
  signing_key:
67
68
  specification_version: 3
68
- summary: Image Processor
69
+ summary: Ruby Wrapper for Card Reader API
69
70
  test_files: []