robocall 0.0.3 → 0.0.4

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: a3f9de8475f225e303393064465740217f63b81a
4
- data.tar.gz: ca8d0429aa4a7abed6f9cd188825d239ebab4d8a
3
+ metadata.gz: c3b3f67dd373f081db5faf1babbafba8a8a92ba4
4
+ data.tar.gz: f61693f004bf1758e0ee1c188515029840296da3
5
5
  SHA512:
6
- metadata.gz: 0429abcbbfdbc9959d52496feacdee9568df8047c668c41246f7d9ff0d1ab237c13d36cb720e00077354ee2cf8a9cd7c780e91411b431250223ea65e0e9c25cc
7
- data.tar.gz: ea64c7866fc655ce9900f069c6055cc8310666b36cc5e7bfa58ba41c82c442c87a940c1a1d89e4e58d3ef30545212d87feae5ae1e88993d49f8f731a1c5e4520
6
+ metadata.gz: bf49fa76d74b87f42f6ac0d4f0e3d54abc55a0c99064a9fbee3d93a1b18669be7bbc18baf4c04a211e582ccadf91e70af15eec46cb154b73f9d5baf36243c730
7
+ data.tar.gz: f1ee6a7121a5e556541d4e70c267c7a702f1560fccfa7e05f658dbebea9a502f7dd380592bf22b21f4db25083f7a794e26d1dcf521d21c69b1d64923f7d8abc7
@@ -18,7 +18,15 @@ module Robocall
18
18
  error = "The token was invalid" unless @r && @r.token == params[:token]
19
19
  if error != ''
20
20
  @error = error
21
- template = File.read('app/views/robocall/robocalls/error.xml.haml')
21
+ template = <<'HAML'
22
+ <?xml version=\"1.0\" encoding=\"UTF-8\"?>
23
+
24
+ %Say{:voice => 'alice'}
25
+ An error has occured retreieveing your automatic message.
26
+ Specifically,
27
+ = error
28
+ HAML
29
+
22
30
  xml = Haml::Engine.new(template).to_html(Object.new, {:error => error} )
23
31
  render :xml => xml, :content_type => 'application/xml'
24
32
  else
@@ -1,3 +1,3 @@
1
1
  module Robocall
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/robocall.rb CHANGED
@@ -3,6 +3,7 @@ require 'twilio-ruby'
3
3
  require File.dirname(__FILE__) + "/../app/models/robocall/robocall"
4
4
 
5
5
  module Robocall
6
+
6
7
  class << self
7
8
  attr_accessor :sid, :auth_token, :from_phone_number, :base_path
8
9
 
@@ -30,9 +31,13 @@ module Robocall
30
31
  )
31
32
  end
32
33
 
33
- def send_robocall(to: to, text: text, language: :english, from: from_phone_number)
34
+ def send_robocall(to: to, text: text, language: 'en-US', from: from_phone_number)
34
35
  # Render XML
35
- template = File.read('app/views/robocall/robocalls/connected_to_caller.xml.haml')
36
+ template = <<'HAML'
37
+ <?xml version='1.0' encoding='utf-8' ?>
38
+ %Say{:voice => 'alice', :language => language}
39
+ = text
40
+ HAML
36
41
  data = {}
37
42
  data['text'] = text
38
43
  data['language'] = language
Binary file
@@ -1450,3 +1450,15 @@ Connecting to database specified by database.yml
1450
1450
   (2.9ms) DROP TABLE "robocall_robocalls"
1451
1451
   (2.0ms) CREATE TABLE "robocall_robocalls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "xml" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1452
1452
   (0.1ms) SELECT version FROM "schema_migrations"
1453
+ Connecting to database specified by database.yml
1454
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1455
+  (0.4ms) select sqlite_version(*)
1456
+  (1.8ms) DROP TABLE "robocall_robocalls"
1457
+  (1.4ms) CREATE TABLE "robocall_robocalls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "xml" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1458
+  (0.1ms) SELECT version FROM "schema_migrations"
1459
+ Connecting to database specified by database.yml
1460
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1461
+  (0.4ms) select sqlite_version(*)
1462
+  (2.6ms) DROP TABLE "robocall_robocalls"
1463
+  (1.8ms) CREATE TABLE "robocall_robocalls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "xml" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1464
+  (0.1ms) SELECT version FROM "schema_migrations"
@@ -3716,3 +3716,49 @@ Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.2ms)
3716
3716
  SQL (0.5ms) INSERT INTO "robocall_robocalls" ("created_at", "token", "updated_at", "xml") VALUES (?, ?, ?, ?) [["created_at", Mon, 12 Aug 2013 19:21:23 UTC +00:00], ["token", "2bcfb9b6e5a8929d2122717047a94a91"], ["updated_at", Mon, 12 Aug 2013 19:21:23 UTC +00:00], ["xml", "<?xml version='1.0' encoding='utf-8' ?>\n<Say language='english' voice='alice'>\n Hello you there\n</Say>\n"]]
3717
3717
   (0.0ms) RELEASE SAVEPOINT active_record_1
3718
3718
   (0.7ms) rollback transaction
3719
+ Connecting to database specified by database.yml
3720
+  (0.1ms) begin transaction
3721
+ SQL (4.1ms) INSERT INTO "robocall_robocalls" ("created_at", "token", "updated_at", "xml") VALUES (?, ?, ?, ?) [["created_at", Mon, 12 Aug 2013 20:44:37 UTC +00:00], ["token", "MyString"], ["updated_at", Mon, 12 Aug 2013 20:44:37 UTC +00:00], ["xml", "<foo>"]]
3722
+  (1.4ms) commit transaction
3723
+  (0.1ms) begin transaction
3724
+ Processing by Robocall::RobocallsController#connected_to_caller as HTML
3725
+ Parameters: {"token"=>"MyString", "id"=>"1"}
3726
+ Robocall::Robocall Load (0.3ms) SELECT "robocall_robocalls".* FROM "robocall_robocalls" WHERE "robocall_robocalls"."id" = 1 LIMIT 1
3727
+ Completed 200 OK in 19ms (Views: 0.2ms | ActiveRecord: 0.3ms)
3728
+  (0.1ms) rollback transaction
3729
+  (0.1ms) begin transaction
3730
+ Processing by Robocall::RobocallsController#connected_to_caller as HTML
3731
+ Parameters: {"token"=>"warble", "id"=>"1"}
3732
+ Robocall::Robocall Load (0.2ms) SELECT "robocall_robocalls".* FROM "robocall_robocalls" WHERE "robocall_robocalls"."id" = 1 LIMIT 1
3733
+ Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.2ms)
3734
+  (0.1ms) rollback transaction
3735
+  (0.1ms) begin transaction
3736
+  (0.1ms) SAVEPOINT active_record_1
3737
+ SQL (0.5ms) INSERT INTO "robocall_robocalls" ("created_at", "token", "updated_at", "xml") VALUES (?, ?, ?, ?) [["created_at", Mon, 12 Aug 2013 20:44:37 UTC +00:00], ["token", "36c245f20bdbdb03e7d538beac79f322"], ["updated_at", Mon, 12 Aug 2013 20:44:37 UTC +00:00], ["xml", "<?xml version='1.0' encoding='utf-8' ?>\n<Say language='en-US' voice='alice'>\n Hello you there\n</Say>\n"]]
3738
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3739
+  (0.5ms) rollback transaction
3740
+  (0.1ms) begin transaction
3741
+  (0.1ms) rollback transaction
3742
+ Connecting to database specified by database.yml
3743
+  (0.1ms) begin transaction
3744
+ SQL (4.2ms) INSERT INTO "robocall_robocalls" ("created_at", "token", "updated_at", "xml") VALUES (?, ?, ?, ?) [["created_at", Mon, 12 Aug 2013 20:48:25 UTC +00:00], ["token", "MyString"], ["updated_at", Mon, 12 Aug 2013 20:48:25 UTC +00:00], ["xml", "<foo>"]]
3745
+  (2.4ms) commit transaction
3746
+  (0.1ms) begin transaction
3747
+ Processing by Robocall::RobocallsController#connected_to_caller as HTML
3748
+ Parameters: {"token"=>"MyString", "id"=>"1"}
3749
+ Robocall::Robocall Load (0.2ms) SELECT "robocall_robocalls".* FROM "robocall_robocalls" WHERE "robocall_robocalls"."id" = 1 LIMIT 1
3750
+ Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.2ms)
3751
+  (0.1ms) rollback transaction
3752
+  (0.1ms) begin transaction
3753
+ Processing by Robocall::RobocallsController#connected_to_caller as HTML
3754
+ Parameters: {"token"=>"warble", "id"=>"1"}
3755
+ Robocall::Robocall Load (0.2ms) SELECT "robocall_robocalls".* FROM "robocall_robocalls" WHERE "robocall_robocalls"."id" = 1 LIMIT 1
3756
+ Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.2ms)
3757
+  (0.1ms) rollback transaction
3758
+  (0.1ms) begin transaction
3759
+  (0.1ms) rollback transaction
3760
+  (0.1ms) begin transaction
3761
+  (0.1ms) SAVEPOINT active_record_1
3762
+ SQL (0.5ms) INSERT INTO "robocall_robocalls" ("created_at", "token", "updated_at", "xml") VALUES (?, ?, ?, ?) [["created_at", Mon, 12 Aug 2013 20:48:25 UTC +00:00], ["token", "5f8b65b32ca0558eecab7bf8e66731ac"], ["updated_at", Mon, 12 Aug 2013 20:48:25 UTC +00:00], ["xml", "<?xml version='1.0' encoding='utf-8' ?>\n<Say language='en-US' voice='alice'>\n Hello you there\n</Say>\n"]]
3763
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3764
+  (0.6ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robocall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reto Stamm
@@ -106,8 +106,6 @@ files:
106
106
  - app/helpers/robocall/application_helper.rb
107
107
  - app/models/robocall/robocall.rb
108
108
  - app/views/layouts/robocall/application.html.erb
109
- - app/views/robocall/robocalls/connected_to_caller.xml.haml
110
- - app/views/robocall/robocalls/error.xml.haml
111
109
  - config/routes.rb
112
110
  - db/migrate/20130807225623_create_robocall_robocalls.rb
113
111
  - lib/robocall/engine.rb
@@ -157,7 +155,6 @@ files:
157
155
  - spec/dummy/script/rails
158
156
  - spec/factories/robocall_robocalls.rb
159
157
  - spec/lib/robocall_spec.rb
160
- - spec/models/robocall/robocall_spec.rb
161
158
  - spec/routing/robocall/robocalls_routing_spec.rb
162
159
  - spec/spec_helper.rb
163
160
  homepage: https://github.com/Originate/robocall
@@ -225,6 +222,5 @@ test_files:
225
222
  - spec/dummy/script/rails
226
223
  - spec/factories/robocall_robocalls.rb
227
224
  - spec/lib/robocall_spec.rb
228
- - spec/models/robocall/robocall_spec.rb
229
225
  - spec/routing/robocall/robocalls_routing_spec.rb
230
226
  - spec/spec_helper.rb
@@ -1,3 +0,0 @@
1
- <?xml version='1.0' encoding='utf-8' ?>
2
- %Say{:voice => 'alice', :language => language}
3
- = text
@@ -1,6 +0,0 @@
1
- <?xml version=\"1.0\" encoding=\"UTF-8\"?>
2
-
3
- %Say{:voice => 'alice'}
4
- An error has occured retreieveing your automatic message.
5
- Specifically,
6
- = error
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Robocall
4
- describe Robocall do
5
- pending "add some examples to (or delete) #{__FILE__}"
6
- end
7
- end