tumblr_draftking 0.9.0 → 0.9.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: 049132366daff875b43a74dfdbd429cf778baeb7
4
- data.tar.gz: e40794d1bdcb8d41a22627d75d682d370337ebcc
3
+ metadata.gz: b467fdc8e8dfff072274c922a778113eafed27cc
4
+ data.tar.gz: b75d1550b3bc6595f50cb6aa66a77e15903fc2f9
5
5
  SHA512:
6
- metadata.gz: a47bbd200d6283ffad17da8322a05f514d7814bd17d1d3891459f1121859919e29d338dc6ffb150f352b5e04675bdb0a9f1485207087c22d6ea3af199c7c939c
7
- data.tar.gz: 876764909b4983d5078ad0a620cf1698bf1ead4df28068148a36ab193c9ff2abb926a870de2d63bdf23199a01adab315db2648547c8bf930f70be86650d7652f
6
+ metadata.gz: 2ea18de0ec33ddb903810e4f0273e88880d4f18b982d0e848a0b160d248955ef122be729dc57ef8470de5e11be94ed535beafa89b29cddafefe9be421c270965
7
+ data.tar.gz: b921fa8dae0ee1ef5b38ccc3bb0b123c18d8653bf74db3230a2726f7d148025579b83eab235b325d0d5ebd579c3490b678de424c05c5248fb2ee8f5ab12504c5
@@ -1,4 +1,7 @@
1
1
  # Changelog :: tumblr_draftking
2
+ ## Version 0.9.0.1
3
+ + Adjusted movedrafts logic to better account for passed limits
4
+
2
5
  ## Version 0.9.0
3
6
  + New! Batch upload and comment photos from a file.
4
7
 
data/README.md CHANGED
@@ -241,10 +241,13 @@ $ dk ap -b 'test-blog' -c 'draftking auto poster' -k -t 'new,tags,to,add' -s :dr
241
241
  - Upload to secondary blog (-b BLOG_NAME)
242
242
  - Provide a url to visit when photo is clicked (-l LINK_URL)
243
243
  - Add tags #blog2, #my upload (-t)
244
+ - Input file format example available via `$ dk help ups`
244
245
 
245
246
  ```ruby
246
247
  $ dk ups -f /Users/meis/Desktop/new_stuff.txt -b blog2 -l blog2.tumblr.com -t 'blog2, my upload,'
247
- ```
248
+ ```
249
+
250
+
248
251
 
249
252
  #### Testing Console
250
253
  The dk console can act as a sandbox while you explore the api or you can use it to actively manage your account.
@@ -45,6 +45,7 @@ module DK
45
45
  @source = process_source(options[:source])
46
46
  @before_id = options[:before_id] || 0
47
47
  @offset = options[:offset] || 0
48
+ @greedy = options[:greedy] || @greedy
48
49
  @limit = options[:limit]
49
50
  @type = options[:type]
50
51
  @blog_url = tumblr_url(@blog_name)
@@ -34,7 +34,6 @@ module DK
34
34
  options[:message] = 'Moving Drafts -> Queue: '
35
35
  options[:shuffle] = true
36
36
  options[:state] = DK::QUEUE
37
- options[:limit] = options[:greedy] ? (nil || options[:limit]) : @q_space
38
37
  post_operation(options) do |post, index|
39
38
  next false unless index_within_limit?(index, @q_space)
40
39
  next false unless post.has_key_text?(@key_text)
@@ -46,6 +46,7 @@ module DK
46
46
  process_options(options)
47
47
  act_on_blog(name: @blog_name)
48
48
  posts = @shuffle ? get_posts.reverse.shuffle : get_posts.reverse
49
+ posts = posts.take(@limit) if @limit
49
50
  work = posts_to_queue(posts)
50
51
  reporter = options[:reporter] || DK::Reporter
51
52
  [work, work.size, Queue.new, reporter]
@@ -124,7 +125,7 @@ module DK
124
125
  print "Getting posts...\r" unless @mute
125
126
  return some_test_data if @test_data
126
127
  return some_posts(offset: @offset) if dashboard?
127
- return all_posts.uniq unless @limit
128
+ return all_posts.uniq if @greedy || @limit.nil?
128
129
  return some_posts(offset: @offset, before_id: @before_id) if @limit <= 50
129
130
  limited_posts
130
131
  end
@@ -4,6 +4,8 @@ include DK::Posts
4
4
  module DK
5
5
  # Tumblr Post
6
6
  class Post
7
+ attr_accessor :comment, :image, :photoset, :changed, :saved, :comment
8
+ attr_accessor :state, :data, :reblog_key, :tags, :blog_url, :summary
7
9
  # @param hash [Hash] Post Data
8
10
  # @param keep_tree [Bool] Attach Reblog Tree?
9
11
  def initialize(hash, keep_tree: nil)
@@ -19,6 +21,7 @@ module DK
19
21
  @changed = false
20
22
  @saved = 0
21
23
  @comment = @data.reblog.comment
24
+ @from = @data.trail.first.blog.name rescue '<no ID>'
22
25
 
23
26
  # Direct map
24
27
  @id = @data.id
@@ -1,3 +1,3 @@
1
1
  module DK
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.0.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.9.0
4
+ version: 0.9.0.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: 2018-01-05 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tumblr_client