amaranth 0.1.0 → 0.1.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: 8fbcb3bfd0d621e2c3a6c7e4236787b2582ce1c3
4
- data.tar.gz: ea9e65e7356762f769f3e92d82e9580109b9dcc2
3
+ metadata.gz: 4026edf55c5d3e188e34e96c8a5d3f2c4c625e00
4
+ data.tar.gz: f54eb5a0962a0195a6b48a2563098a64522a7830
5
5
  SHA512:
6
- metadata.gz: 605def05c4af919d5048586db6b98f6288927961585d55a741e38b053ef9287278604a5002eda143646c48999090d900cd22a5eb1565573c366023db8c84d12e
7
- data.tar.gz: 07e1af87aae56a482b24b266eebf0e23d43ecf17e04b638c9f485f7b4324c160f89d573e14f6539586864b1f0b3cf19b39848f7c0e41ebf63c9c910106201019
6
+ metadata.gz: 04e238c65780485a47f737c01b14f7857350b16df4aa05f0d3c6b5ad38e1a946d92920c9a05111e034209c95bde9294ab136df8c5df2b3d86d1c1e7d2350b0f7
7
+ data.tar.gz: cbdb03e24d9a5aeefb0a5189244a36eab65b9fb2091c952a3aa2045b32f075e2d431dcbeddc0e8f47f969ed6c1d120ab968ddd62218a87c802af92cfb18e4975
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  /.ruby-version
11
11
  /.ruby-gemset
12
+ /.byebug_history
data/Gemfile CHANGED
@@ -2,3 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in amaranth.gemspec
4
4
  gemspec
5
+
6
+ gem "byebug"
7
+
@@ -1,3 +1,3 @@
1
1
  module Amaranth
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -66,11 +66,18 @@ module Amaranth
66
66
  private
67
67
 
68
68
  READONLY_ATTRIBUTES = %i(all_urls languages)
69
+ OMIT_IF_BLANK_ATTRIBUTES = %i(duration)
69
70
 
70
71
  def save_existing
71
- attributes = to_h.delete_if { |key, _| READONLY_ATTRIBUTES.include?(key) }
72
+ attributes = to_h
73
+ attributes.reject! { |key, value| READONLY_ATTRIBUTES.include?(key) }
74
+ attributes.reject! { |key, value| OMIT_IF_BLANK_ATTRIBUTES.include?(key) && blank?(value) }
72
75
  Request.put("/api/videos/#{id}/", attributes)
73
76
  end
77
+
78
+ def blank? value
79
+ value.to_s.strip == ""
80
+ end
74
81
  end
75
82
  end
76
83
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amaranth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-16 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake