turbot 0.0.21 → 0.0.22

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/lib/turbot/auth.rb CHANGED
@@ -40,7 +40,7 @@ class Turbot::Auth
40
40
  end
41
41
 
42
42
  def default_host
43
- "http://turbot"
43
+ "http://turbot.opencorporates.com"
44
44
  end
45
45
 
46
46
  def git_host
@@ -92,14 +92,12 @@ class Turbot::Command::Bots < Turbot::Command::Base
92
92
  # Created new bot template at my_amazing_bot!
93
93
 
94
94
  def generate
95
- puts "running generate"
96
95
  response = api.show_bot(bot)
97
96
  if response.is_a? Turbot::API::SuccessResponse
98
97
  error("There's already a bot called #{bot}")
99
98
  end
100
99
  validate_arguments!
101
100
  language = options[:language] || "ruby"
102
- puts "Generating #{language} code..."
103
101
  manifest_template = File.expand_path("../../../../templates/manifest.json", __FILE__)
104
102
  scraper_template = File.expand_path("../../../../templates/#{language}", __FILE__)
105
103
  license_template = File.expand_path("../../../../templates/LICENSE.txt", __FILE__)
@@ -149,7 +147,7 @@ class Turbot::Command::Bots < Turbot::Command::Base
149
147
  # Push bot code to the turbot server. Must be run from a local bot checkout.
150
148
  #
151
149
  # $ turbot bots:push
152
- # Creating example... done
150
+ # Your bot has been pushed to Turbot and will be reviewed for inclusion as soon as we can. THANKYOU!
153
151
 
154
152
  def push
155
153
  validate_arguments!
@@ -169,6 +167,7 @@ class Turbot::Command::Bots < Turbot::Command::Base
169
167
  File.open(archive_path) do |file|
170
168
  api.update_code(bot, file)
171
169
  end
170
+ puts "Your bot has been pushed to Turbot and will be reviewed for inclusion as soon as we can. THANKYOU!"
172
171
  end
173
172
 
174
173
  alias_command "push", "bots:push"
@@ -180,7 +179,7 @@ class Turbot::Command::Bots < Turbot::Command::Base
180
179
  # $ heroku bots:validate
181
180
  # Validating example... done
182
181
 
183
- def validate
182
+ def validate(opts={})
184
183
  scraper_path = shift_argument || scraper_file(Dir.pwd)
185
184
  validate_arguments!
186
185
  config = parsed_manifest(Dir.pwd)
@@ -208,14 +207,14 @@ class Turbot::Command::Bots < Turbot::Command::Base
208
207
  if !errors.empty?
209
208
  error("LINE WITH ERROR: #{line}\n\nERRORS: #{errors}")
210
209
  end
211
-
210
+ puts line if opts[:dump]
212
211
  if JSON.parse(line).slice(*config['identifying_fields']).blank?
213
212
  error("LINE WITH ERROR: #{line}\n\nERRORS: No value provided for identifying fields")
214
213
  end
215
214
 
216
215
  count += 1
217
216
  end
218
- puts "Validated #{count} records successfully!"
217
+ puts "Validated #{count} records successfully!" if !opts[:dump]
219
218
  end
220
219
 
221
220
  # bots:dump
@@ -227,14 +226,7 @@ class Turbot::Command::Bots < Turbot::Command::Base
227
226
  # {'foo2': 'bar2'}
228
227
 
229
228
  def dump
230
- # This will need to be language-aware, eventually
231
- scraper_path = shift_argument || scraper_file(Dir.pwd)
232
- validate_arguments!
233
- count = 0
234
- run_scraper_each_line("#{scraper_path} #{bot}") do |line|
235
- puts line
236
- count += 1
237
- end
229
+ validate(:dump => true)
238
230
  end
239
231
 
240
232
  # bots:single
@@ -263,9 +255,9 @@ class Turbot::Command::Bots < Turbot::Command::Base
263
255
 
264
256
  # bots:preview
265
257
  #
266
- # Send bot data to Angler for remote previewing / sharing
258
+ # Send bot data to Turbot for remote previewing / sharing
267
259
  #
268
- # Sending example to Angler... done
260
+ # Sending example to turbot... done
269
261
  def preview
270
262
  scraper_path = shift_argument || scraper_file(Dir.pwd)
271
263
  validate_arguments!
@@ -273,7 +265,7 @@ class Turbot::Command::Bots < Turbot::Command::Base
273
265
  batch = []
274
266
  count = 0
275
267
  config = parsed_manifest(Dir.pwd)
276
- puts "Sending to angler... "
268
+ puts "Sending to turbot... "
277
269
 
278
270
  api.destroy_draft_data(bot)
279
271
 
@@ -18,9 +18,8 @@ class Turbot::Command::Status < Turbot::Command::Base
18
18
  def index
19
19
  validate_arguments!
20
20
 
21
- turbot_status_host = ENV['TURBOT_STATUS_HOST'] || "status.turbot.com"
22
21
  require('excon')
23
- status = json_decode(Excon.get("https://#{turbot_status_host}/api/v3/current-status.json", :nonblock => false).body)
22
+ status = json_decode(Excon.get("http://turbot.opencorporates.com/current-status.json", :nonblock => false).body)
24
23
 
25
24
  styled_header("Turbot Status")
26
25
 
@@ -1,3 +1,3 @@
1
1
  module Turbot
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: