tumblr_draftking 0.8.0 → 0.8.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: c93a9633bd0ae2cfd31d6791298f44bffaf345da
4
- data.tar.gz: 1441e5671dd6325a9bfc7a05669d1bf879b02ad5
3
+ metadata.gz: b83cb67065dc499c94b9529b1ecf3924d010c678
4
+ data.tar.gz: 44294c98f5823ac5031648a6f7a9148d77edf3ac
5
5
  SHA512:
6
- metadata.gz: 80db75ddb4b552d75f8ecbd64055fd8e2655c31a1ce2038908e9642ab55ba715cbb13db040212e6509d27850eda7697c482c3a2f17a7475d026744c37b4e5413
7
- data.tar.gz: a5569f9c6fc6aa2254792ed5f30c211e16b7d6332bc6a7399d61ad904411652c9a5db95501401618420d497a5308fc7518f33690586ac3311c308b81c7d49e9d
6
+ metadata.gz: b4ef6cb3e39874d16615ac7aca1c3b1edef1ee8e42df977f7ee68adaadb36ef80c5b062e52033f88354d972f90f8f2e01c4f0c561c156d3dd10834ba233ca119
7
+ data.tar.gz: cab87edd90c5594040c2ddb7931f155f7c32bf927696d70d857cf00156e161c96dc33dfe23e895431e7f5f3ae040e2a144b7a7c78c8ff4a49c03f2fec71fb216
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog :: tumblr_draftking
2
+ ## Version 0.8.1
3
+ + Bugfix: Commands applied to queued posts resulted in post being published.
4
+
2
5
  ## Version 0.8.0
3
6
  + DK#post_operation now returns both modified count and modified posts. Use `post_operation(opts)[0]` for previous behavior.
4
7
  + Access all Tumblr Post data via DK::Post. i.e. `DK::Post.new(post_data).photos.first.original_size.url`
data/README.md CHANGED
@@ -5,17 +5,15 @@ DraftKing is not associated with Tumblr
5
5
  [![Test Coverage](https://codeclimate.com/github/meissadia/tumblr_draftking/badges/coverage.svg)](https://codeclimate.com/github/meissadia/tumblr_draftking/coverage)
6
6
 
7
7
  DraftKing for Tumblr takes the hassle out of managing your draft queue!
8
- + **(New!) Save and name your own DK commands!**
8
+ + **(New!) Save and name your own [DK commands](#custom-commands)!**
9
9
  + **Automate the addition of comments and tags.**
10
10
  + **Strip away old comments.**
11
11
  + **Easily replenish your queue.**
12
12
  + **Randomize post order to add variety.**
13
13
  + **Manage multiple accounts.**
14
14
 
15
- Version 0.8.0
16
- + DK#post_operation now returns both modified count and modified posts. Use `post_operation(opts)[0]` for previous behavior.
17
- + Access all Tumblr Post data via DK::Post. i.e. `DK::Post.new(post_data).photos.first.original_size.url`
18
- + Post.image (first photo, original size), Post.alt_sizes, Post.photos (array of Photo structs)
15
+ Version 0.8.1
16
+ + Bugfix: Commands applied to queued posts resulted in post being published.
19
17
 
20
18
  + Please report any [issues] you encounter!
21
19
  + [Change Log](./CHANGELOG.md)
@@ -1,7 +1,9 @@
1
1
  module DK
2
2
  # Helpers for Command Line Interface
3
3
  module CliHelpers
4
- VALID_OPTS = [:simulate, :limit, :blog, :key_text, :comment, :add_tags, :mute, :publish, :keep_tags, :keep_comments, :source, :config].freeze
4
+ VALID_OPTS = [:simulate, :limit, :blog, :key_text, :comment, :add_tags,
5
+ :mute, :publish, :keep_tags, :keep_comments, :source,
6
+ :config].freeze
5
7
 
6
8
  private
7
9
 
@@ -23,7 +23,6 @@ module DK
23
23
  # Direct map
24
24
  @id = @data.id
25
25
  @reblog_key = @data.reblog_key
26
- @state = @data.state
27
26
  @summary = @data.summary
28
27
  @tags = @data.tags
29
28
 
@@ -105,7 +104,7 @@ module DK
105
104
  res = client.edit @blog_url,
106
105
  id: id,
107
106
  reblog_key: @reblog_key,
108
- state: @state,
107
+ state: validate_state,
109
108
  attach_reblog_tree: @keep_tree,
110
109
  tags: @tags.join(','),
111
110
  caption: @comment
@@ -177,5 +176,10 @@ module DK
177
176
  def csv_to_a(csv)
178
177
  csv.split(',')
179
178
  end
179
+
180
+ def validate_state
181
+ raise 'Invalid Post.state' unless VALID_STATE.include?(@state)
182
+ @state
183
+ end
180
184
  end
181
185
  end
@@ -1,3 +1,3 @@
1
1
  module DK
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_draftking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meissa Dia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tumblr_client