atlas 1.2.1 → 1.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8ff1489b801883f3b882fb78019dfb1082583d8
4
- data.tar.gz: cd4e91f98e9fa33b6ec3c5163f6d7c3332030a58
3
+ metadata.gz: af11e09114885b35e7d35e684f2075699ee52816
4
+ data.tar.gz: a0e9ac3d3cbef2031ae55c711ca4aee3186cc250
5
5
  SHA512:
6
- metadata.gz: 957112c6bb96cb0139c366e69fe66f0fa45be9d108b4393e0e2ccaecaa94052a8da6d315cd8e4b005dfe833c4b50d6b2b4e09257ca39648115b62e98b0c6cdca
7
- data.tar.gz: b127d0b494e31f40ae44048afd3a993ece45316f3133fede40959bf97eb4871ca5103b0cf2f47efb8a16f8dc74b7d94a2d7ff613b561ac6d4151cf4c5283937a
6
+ metadata.gz: 488a6879bb4629a2820268a124f13e63632b71e7665c9576c5db0a6e8794f3dcfb8fb0d2224df3ab5f09ca363936dd88e6f270a6da18ca3ba9280d369e4b96a1
7
+ data.tar.gz: 173b901038c488a629642c3da3c1e615931f88b097ea56db3248dd7097873c3d5cd875f4159085a387f6f434fbd52746f8a0cbb1fb315cfa6e6a763f3a2c5110
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.3.0 (15/02/2015)
4
+
5
+ * Adds timestamps to `Box`, `BoxVersion` and `BoxProvider`.
6
+
3
7
  ## 1.2.1 (03/10/2015)
4
8
 
5
9
  * Fixes a bug where self-hosted box URLs wouldn't store correctly ([#1][])
@@ -12,6 +12,7 @@ module Atlas
12
12
  class Box < Resource
13
13
  attr_accessor :name, :username, :short_description, :description,
14
14
  :is_private, :current_version, :versions
15
+ date_accessor :created_at, :updated_at
15
16
 
16
17
  # Find a box by it's tag.
17
18
  #
@@ -5,6 +5,7 @@ module Atlas
5
5
  # @attr_accessor [String] download_url The url to download from.
6
6
  class BoxProvider < Resource
7
7
  attr_accessor :name, :original_url, :download_url, :url
8
+ date_accessor :created_at, :updated_at
8
9
 
9
10
  # Find a provider by it's tag.
10
11
  #
@@ -10,6 +10,7 @@ module Atlas
10
10
  class BoxVersion < Resource
11
11
  # Properties of the version.
12
12
  attr_accessor :version, :description, :status, :providers
13
+ date_accessor :created_at, :updated_at
13
14
 
14
15
  # Find a version by it's tag.
15
16
  #
@@ -1,3 +1,5 @@
1
+ require "date"
2
+
1
3
  module Atlas
2
4
  # Base class for representing resources.
3
5
  class Resource
@@ -29,5 +31,21 @@ module Atlas
29
31
  objects = to_hash.map { |k, v| "#{k}=#{v.inspect}" }.join(' ')
30
32
  "#<#{self.class.name}:#{object_id} #{objects}>"
31
33
  end
34
+
35
+ class << self
36
+ def date_writer(*args)
37
+ args.each do |attr|
38
+ define_method("#{attr}=".to_sym) do |date|
39
+ date = date.is_a?(String) ? DateTime.parse(date) : date
40
+ instance_variable_set("@#{attr}", date)
41
+ end
42
+ end
43
+ end
44
+
45
+ def date_accessor(*args)
46
+ attr_reader(*args)
47
+ date_writer(*args)
48
+ end
49
+ end
32
50
  end
33
51
  end
@@ -1,4 +1,4 @@
1
1
  # Version information.
2
2
  module Atlas
3
- VERSION = '1.2.1'
3
+ VERSION = '1.3.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Charlton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-03 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon