tumblr_draftking 0.9.0.2 → 0.9.0.3

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: 73397f43d284e088f59522e62de2c5efbab15cbd
4
- data.tar.gz: 43e8ec38b54f974a22aea975c386e2d42c9d7909
3
+ metadata.gz: 19b8f8d0b44e95c6f4cb027946cab3822bf3afb0
4
+ data.tar.gz: 90eaaa8b530770b958ded47566b8ac0044ac7066
5
5
  SHA512:
6
- metadata.gz: b3f820cd5ad2a09d9c31d536e5351c01a6b0ae6a32153a37092555ae1ec5d2ae0f11f6a53c061dc6ceb3455ed6e7fddaab3925b569db6f13310060dd2cf09d5a
7
- data.tar.gz: d9406d4537072843e8710ca3a79574924c982ebd141117aac76d78986546e8b5e4dd4623446bdf09e2e2772f0bcf820c5d7e751cd9cafef1c2910fc9d39562b1
6
+ metadata.gz: f4abd939e2d8cc687e7a5fbcf4a7e97a146ff8c5880f08fd6747247452d8315b3774bff641b50df5090bee037273220bf8cc9b233d76a7bb70c471fd18595e70
7
+ data.tar.gz: 90d2a12404235f1d3f36852bea1da71a0e11b8e28a9e762532d78d79ab5bd9144f25be538f20014e29751871b74d6e1a3bcdfd14dac78a006a05906f7bc55dcf
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog :: tumblr_draftking
2
+ ## Version 0.9.0.3
3
+ + Shuffle posts more during movedrafts
4
+
2
5
  ## Version 0.9.0.2
3
6
  + Updated gemspec constraints for Psych
4
7
 
@@ -181,7 +181,7 @@ module DK
181
181
  end
182
182
 
183
183
  def validate_state
184
- raise 'Invalid Post.state' unless VALID_STATE.include?(@state)
184
+ raise "Invalid Post.state: #{@state}" unless VALID_STATE.include?(@state)
185
185
  @state
186
186
  end
187
187
  end
@@ -45,13 +45,17 @@ module DK
45
45
  print "Setup\r" unless @mute
46
46
  process_options(options)
47
47
  act_on_blog(name: @blog_name)
48
- posts = @shuffle ? get_posts.reverse.shuffle : get_posts.reverse
48
+ posts = @shuffle ? shufflex(get_posts.reverse, 3) : get_posts.reverse
49
49
  posts = posts.take(@limit) if @limit
50
50
  work = posts_to_queue(posts)
51
51
  reporter = options[:reporter] || DK::Reporter
52
52
  [work, work.size, Queue.new, reporter]
53
53
  end
54
54
 
55
+ def shufflex(arr, num)
56
+ (0..num).to_a.inject(arr) { |m, _| m = m.shuffle; m }
57
+ end
58
+
55
59
  # Create queue of Posts for worker threads
56
60
  def posts_to_queue(posts)
57
61
  work_q = Queue.new
@@ -1,3 +1,3 @@
1
1
  module DK
2
- VERSION = '0.9.0.2'.freeze
2
+ VERSION = '0.9.0.3'.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.2
4
+ version: 0.9.0.3
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-03-26 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tumblr_client