web_merge 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c514ab84c84abc4f88133dde2fce21ba8e2a1b81
4
- data.tar.gz: 3bb31dea086300f008e05eac0f0d0981151eaeb7
3
+ metadata.gz: f9e843644bc9db35f9d1389bea871103ab51bed7
4
+ data.tar.gz: 6248fee37e9185572328502f649da3d3c7509157
5
5
  SHA512:
6
- metadata.gz: f7a5c30238783927772bee0ebb347ac51bb5d81060d6a62954d1fd6ab57e69d1e761ffa69e38f088343c2e0aa5c37bd1fa326785598159e361d20afd9d929501
7
- data.tar.gz: 514fb4ab7d9c16cc3b3cd669d5f176014e643072ce42e1d4f4aeb67a8d752c2c160b87fd79767e876a247797a637269a923a682ed0e8d36420fbf04f8c0686be
6
+ metadata.gz: c1288858d31250371f38e56061306375aa0be294c10435e94cdf366cead7c265b9438bfe55e877248112743215f3754b69d08b3917d8683d3f46bfad4eaf5f1b
7
+ data.tar.gz: 2ea30ab2cc015612b5f4f9757284700f90ebd7befd77fae0d82202a6fb34740556deb723057ade35c0eb886dbb7231f7a28ebb5b00dd6ab1c7f4d8ff5d4129fd
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ ## 1.0.1
2
+
3
+ * Update regex for single line match.
4
+ * Add flatten option to request params.
5
+ * Don't require file_path for update
6
+ * Ability to Pass Options To Create Merge Document
7
+
8
+ ## 1.0.0
9
+
10
+ * Initial release
@@ -10,7 +10,8 @@ module WebMerge
10
10
  validates :type, inclusion: { in: WebMerge::Constants::SUPPORTED_TYPES }
11
11
  validates :output, inclusion: { in: WebMerge::Constants::SUPPORTED_OUTPUTS }
12
12
 
13
- def initialize(name: required(:name), type: required(:type), output: WebMerge::Constants::PDF, file_path: nil, options: {})
13
+ def initialize(client: required(:client), name: required(:name), type: required(:type), output: WebMerge::Constants::PDF, file_path: nil, options: {})
14
+ @client = client
14
15
  @name = name
15
16
  @type = type
16
17
  @output = output
@@ -33,7 +34,7 @@ module WebMerge
33
34
  end
34
35
 
35
36
  def self.all
36
- WebMerge::API.get_documents.map do |doc_hash|
37
+ @client.get_documents.map do |doc_hash|
37
38
  instance = empty_instance
38
39
  instance.send(:update_instance, doc_hash)
39
40
  instance
@@ -51,9 +52,9 @@ module WebMerge
51
52
  def save
52
53
  return false unless valid?
53
54
  response = if new_document?
54
- WebMerge::API.create_document(as_form_data)
55
+ @client.create_document(as_form_data)
55
56
  else
56
- WebMerge::API.update_document(id, as_form_data)
57
+ @client.update_document(id, as_form_data)
57
58
  end
58
59
  update_instance(response.symbolize_keys)
59
60
  true
@@ -65,20 +66,20 @@ module WebMerge
65
66
 
66
67
  def reload
67
68
  raise "Cannot reload a new document, perhaps you'd like to call `save' first?" if new_document?
68
- response = WebMerge::API.get_document(id)
69
+ response = @client.get_document(id)
69
70
  update_instance(response)
70
71
  self
71
72
  end
72
73
 
73
74
  def delete
74
75
  delete = false
75
- WebMerge::API.delete_document(id) { |response| delete = JSON(response.body)["success"] } unless new_document?
76
+ @client.delete_document(id) { |response| delete = JSON(response.body)["success"] } unless new_document?
76
77
  delete
77
78
  end
78
79
 
79
80
  def fields
80
81
  raise "Cannot fetch fields for an unpersisted document, perhaps you'd like to call `save' first?" if new_document?
81
- @fields ||= WebMerge::API.get_document_fields(id)
82
+ @fields ||= @client.get_document_fields(id)
82
83
  end
83
84
 
84
85
  def field_names
@@ -87,7 +88,7 @@ module WebMerge
87
88
 
88
89
  def merge(field_mappings, options = {}, &block)
89
90
  raise "Cannot merge an unpersisted document, perhaps you'd like to call `save' first?" if new_document?
90
- WebMerge::API.merge_document(id, key, field_mappings, options, &block)
91
+ @client.merge_document(id, key, field_mappings, options, &block)
91
92
  end
92
93
 
93
94
  def as_form_data
@@ -1,3 +1,3 @@
1
1
  module WebMerge
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_merge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Clarke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-08 00:00:00.000000000 Z
11
+ date: 2015-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activemodel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  description: Manage and merge Documents using the WebMerge.me REST API
@@ -59,7 +59,8 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
@@ -81,17 +82,17 @@ require_paths:
81
82
  - lib
82
83
  required_ruby_version: !ruby/object:Gem::Requirement
83
84
  requirements:
84
- - - '>='
85
+ - - ">="
85
86
  - !ruby/object:Gem::Version
86
87
  version: '0'
87
88
  required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  requirements:
89
- - - '>='
90
+ - - ">="
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  requirements: []
93
94
  rubyforge_project:
94
- rubygems_version: 2.4.5
95
+ rubygems_version: 2.4.3
95
96
  signing_key:
96
97
  specification_version: 4
97
98
  summary: WebMerge REST API Wrapper