curate_tumblr 1.0.3 → 1.0.4

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.
data/README.md CHANGED
@@ -4,20 +4,25 @@ Reblog and follow in your Tumblr from a file of links.
4
4
 
5
5
  Grow you Tumblr audience by automating the boring tasks !
6
6
 
7
+ **v1.0.3**
8
+
7
9
  ### Installation
8
10
 
9
11
  gem install curate_tumblr
10
12
 
11
13
  ### Quick Example
12
14
 
13
- require 'curate_tumblr'
15
+ **require 'curate_tumblr'**
14
16
 
15
17
  **CurateTumblr.reblog( "kubricklove", "/home/tumblr" )**
16
18
 
17
- reblog links in the queue of tumblr "kubricklove" where config is in
18
- /home/tumblr/kubricklove/kubricklove_config.yaml
19
- and links to reblog are in
20
- /home/tumblr/kubricklove/links/kubricklove_links
19
+ reblog links **in the queue** of tumblr *kubricklove*
20
+
21
+ where **links to reblog** are in file */home/tumblr/kubricklove/links/kubricklove_links*
22
+
23
+ and **config (with oauth)** is in
24
+ */home/tumblr/kubricklove/kubricklove_config.yaml*
25
+
21
26
 
22
27
  ### Features
23
28
 
@@ -29,10 +34,11 @@ and links to reblog are in
29
34
 
30
35
  ### Important
31
36
 
32
- Please note before all **you have to config oauth** for your tumblr.
37
+ Please note before all **you have to config oauth** for your tumblr (and put the codes in the config file, see below).
33
38
 
34
39
  You can see an example of reblog and follow for a kubrick tumblr in the *example* folder.
35
40
 
41
+
36
42
  ## Usage
37
43
 
38
44
  ### oAuth
@@ -217,3 +223,5 @@ The Curate Tumblr gem is Copyright (c) 2013 David Tysman and is licensed under t
217
223
  Feel free to use it for any project.
218
224
 
219
225
  Tumblr is Copyright (c) Tumblr, Inc. The Curate Tumblr gem is NOT affiliated with Tumblr, Inc.
226
+
227
+ www.davidtysman.com
@@ -2,7 +2,7 @@ Gem::Specification.new do |gem|
2
2
  gem.add_dependency 'tumblr_client'
3
3
  gem.add_dependency 'logger'
4
4
  gem.name = 'curate_tumblr'
5
- gem.version = '1.0.3'
5
+ gem.version = '1.0.4'
6
6
  gem.authors = ['David Tysman']
7
7
  gem.description = 'CurateTumblr - reblog and follow Tumblr links'
8
8
  gem.summary = 'Reblog and follow Tumblr'
@@ -51,15 +51,21 @@ module CurateTumblr
51
51
  end
52
52
 
53
53
  def init_tumblr!( hash_config={} )
54
- hash_config = get_config_from_yaml if hash_config.empty?
55
- set_log
56
- init_client!( hash_config )
57
- init_infos!( hash_config )
58
- init_extract_links!( hash_config )
59
- init_follow!( hash_config )
60
- init_reblog!( hash_config )
61
- init_post!( hash_config )
62
- @is_stop = false
54
+ @is_stop = false
55
+ check_config_files
56
+ hash_config = get_config_from_yaml if hash_config.empty? && !is_stop
57
+ if @is_stop
58
+ puts "\nError : the application can't init. Please check the paths and the config file"
59
+ return false
60
+ end
61
+ set_log
62
+ init_client!( hash_config )
63
+ init_infos!( hash_config )
64
+ init_extract_links!( hash_config )
65
+ init_follow!( hash_config )
66
+ init_reblog!( hash_config )
67
+ init_post!( hash_config )
68
+ true
63
69
  end
64
70
 
65
71
  def config_from_yaml
@@ -68,7 +74,42 @@ module CurateTumblr
68
74
  config_infos( hash_config )
69
75
  end
70
76
 
77
+ def check_config_files
78
+ if !Dir.exists?( @directory )
79
+ puts "\nOups! The directory #{@directory} doesn't exist. \nYou need it for your tumblrs subdirectories. \nPlease create it or change the path."
80
+ @is_stop = true
81
+ return false
82
+ end
83
+ if !Dir.exists?( get_path_tumblr )
84
+ puts "\nOups! The directory #{get_path_tumblr} doesn't exist. \nYou need it for your tumblr links and config. \nPlease create it or change the path."
85
+ @is_stop = true
86
+ return false
87
+ end
88
+ if !Dir.exists?( get_path_links )
89
+ puts "\nOups! The directory #{get_path_links} doesn't exist. \nYou need it for set the links to follow and reblog. \nPlease create it or change the path."
90
+ @is_stop = true
91
+ return false
92
+ end
93
+ if !Dir.exists?( get_path_logs )
94
+ puts "\nOups! The directory #{get_path_logs} doesn't exist. \nThe application needs it for write logs. \nPlease create it or change the path."
95
+ @is_stop = true
96
+ return false
97
+ end
98
+ if !File.exists?( get_filename_config )
99
+ puts "\nOups! The config file #{get_filename_config} doesn't exist. \nYou need it for set oauth tokens. \nPlease create it or change the path."
100
+ @is_stop = true
101
+ return false
102
+ end
103
+ if !File.exists?( get_filename_links )
104
+ puts "\nOups! The file #{get_filename_links} doesn't exist. \nYou need it for set the links to reblog. \nPlease create it or change the path."
105
+ @is_stop = true
106
+ return false
107
+ end
108
+ true
109
+ end
110
+
71
111
  def get_config_from_yaml
112
+ return false if @is_stop
72
113
  file_yaml = get_filename_config
73
114
  raise "config file YAML #{file_yaml} doesn't exist" if !File.exist?( file_yaml )
74
115
  begin
@@ -8,6 +8,7 @@ module CurateTumblr
8
8
 
9
9
  class << self
10
10
  def render( object_render, name, is_display_infos=true )
11
+ return false if object_render.is_stop
11
12
  puts "\n#{name} begin at #{Time.now.strftime("%H:%m")} (max #{object_render.get_max})" if is_display_infos
12
13
  object_render.render_links_from_file
13
14
  puts "\n#{name} end at #{Time.now.strftime("%H:%m")}" if is_display_infos
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curate_tumblr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: