brick_ftp 0.7.1 → 0.8.0

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
  SHA256:
3
- metadata.gz: 5a0069f587ef3fe9093bac0c8226af17eecc3634cb461bee69b2de18748b6b1f
4
- data.tar.gz: 31a6d9bb6e85cfe8fec3f246c97bc38632b42fdd1a3f6191f09f4e82948c89a7
3
+ metadata.gz: 7b5f39154f9f9cb909e38e0a7b3b20e7da36921d348340f21186b272cc06332b
4
+ data.tar.gz: 1cda57b5a7f2c3170ec94cbda3dc0c545a056aab7a1fb1893aed5ef0382d87d8
5
5
  SHA512:
6
- metadata.gz: 3ccbfa02cab23edd32e91400fc5bc3fc1a0ec75dbe9e763024249c7271d78abede39074994fe1bae73e613f7f09f6c44761bb392f16bb8d1ff92831e0da4d98d
7
- data.tar.gz: 68cd755ff67fcb37d21ca17743d2df51ceceebbf54f0afb24d38459f92c848df4b8043db36345a47376107224a0f94473dbbdfc6fc2df5e43b4d47e382d7a21d
6
+ metadata.gz: c678bfe33641ef68904283954d8fab9c8756b75265798fe53bec129fb7c65a30259a954fb894e3d029ded471d37b98d268a8d5f860d404e5d3a320f4b082c563
7
+ data.tar.gz: 508b6cdb4d5c1f7e250d2ffe48fd966d87add82ae8e33538d7b7f8c99cee5c5f08af67b05b3d2ba5ef7ca8d183829727b96576aa0e7589bc9620398450743ab7
data/CHANGELOG.md CHANGED
@@ -2,10 +2,10 @@ Changelog
2
2
  ====
3
3
 
4
4
 
5
- [unreleased](https://github.com/koshigoe/brick_ftp/compare/v0.7.1...master)
5
+ [unreleased](https://github.com/koshigoe/brick_ftp/compare/v0.8.0...master)
6
6
  ----
7
7
 
8
- [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.7.1...master)
8
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.8.0...master)
9
9
 
10
10
  ### Enhancements:
11
11
 
@@ -14,6 +14,25 @@ Changelog
14
14
  ### Breaking Changes:
15
15
 
16
16
 
17
+ [v0.8.0](https://github.com/koshigoe/brick_ftp/compare/v0.7.1...v0.8.0)
18
+ ----
19
+
20
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.7.1...v0.8.0)
21
+
22
+ ### Enhancements:
23
+
24
+ ### Fixed Bugs:
25
+
26
+ - [#92](https://github.com/koshigoe/brick_ftp/pull/92) Re-Overwrite `as_json` to avoid to too much loop.
27
+ - fixes [#91](https://github.com/koshigoe/brick_ftp/issues/91)
28
+
29
+ ### Breaking Changes:
30
+
31
+ - [#92](https://github.com/koshigoe/brick_ftp/pull/92)
32
+ - Change type of key of returned Hash object from `BrickFTP::API::Base#as_json` to `String`.
33
+ - Initialize `BrickFTP::API::Base#properties` with all defined attributes.
34
+
35
+
17
36
  [v0.7.1](https://github.com/koshigoe/brick_ftp/compare/v0.7.0...v0.7.1)
18
37
  ----
19
38
 
@@ -43,7 +43,7 @@ module BrickFTP
43
43
  attr_reader :properties
44
44
 
45
45
  def initialize(params = {})
46
- @properties = {}
46
+ initialize_properties
47
47
  params.each { |k, v| write_property(k, v) }
48
48
  end
49
49
 
@@ -73,7 +73,7 @@ module BrickFTP
73
73
  end
74
74
 
75
75
  def as_json
76
- self.class.attributes.each_with_object({}) { |name, res| res[name] = read_property(name) }
76
+ properties.dup
77
77
  end
78
78
 
79
79
  def to_json
@@ -94,6 +94,11 @@ module BrickFTP
94
94
 
95
95
  private
96
96
 
97
+ def initialize_properties
98
+ @properties = {}
99
+ self.class.attributes.each { |key| write_property(key, nil) }
100
+ end
101
+
97
102
  def respond_to_missing?(method_name, _include_private)
98
103
  self.class.attributes.include?(method_name.to_sym)
99
104
  end
@@ -79,6 +79,16 @@ module BrickFTP
79
79
  def commit
80
80
  UploadingResult.create(path: path, ref: ref)
81
81
  end
82
+
83
+ # Return single uploading session object.
84
+ #
85
+ # NOTE: The `#as_json` method will be overwritten by active_supprt.
86
+ #
87
+ # @return [Hash] a JSON serializable object
88
+ #
89
+ def as_json
90
+ properties.dup
91
+ end
82
92
  end
83
93
  end
84
94
  end
@@ -1,3 +1,3 @@
1
1
  module BrickFTP
2
- VERSION = '0.7.1'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brick_ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koshigoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler