amazonecho 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/amazonecho/railtie.rb +43 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcb3728073789c3e5fc11c0567460cb8f190c4ed
|
4
|
+
data.tar.gz: 2dff179a9f505645a73638055a1215f9e32af5e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8abb5b72d19f3ea6573e36f3efbc2cedf4b1d4d7819873dc1a78c84c71bf40f2c5f1b458d223e6db4580935ad66dc3ea018c7800bae71821b9589041f223e49a
|
7
|
+
data.tar.gz: a4d1ac26c4809d3a36c156fe784ed665c4716d93256341d5792e2b39d5399d255612d17a16644d7c8b67111f50e895550e186151a50ea97796af673f71aeef0e
|
data/lib/amazonecho/railtie.rb
CHANGED
@@ -5,31 +5,59 @@ class AmazonEcho
|
|
5
5
|
rake_tasks do
|
6
6
|
directory "app"
|
7
7
|
directory "app/controllers"
|
8
|
+
directory "config"
|
9
|
+
|
10
|
+
|
8
11
|
task :amazonecho do
|
12
|
+
Rake::Task["intent_controller.rb"].invoke
|
13
|
+
Rake::Task["routes.rb"].invoke
|
14
|
+
puts "\n\nReady to build alexa skills!\n\n"
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
file "intent_controller.rb" => "app/controllers" do
|
21
|
+
|
9
22
|
string =
|
10
23
|
'class IntentController < ApplicationController
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
skip_before_action :verify_authenticity_token
|
25
|
+
#Don`t forget to add all the Intent methods as helpers and to update your routes!
|
26
|
+
#helper_method: example
|
27
|
+
def intents
|
28
|
+
respond_to do |format|
|
29
|
+
format.json {
|
30
|
+
render json: AlexaResponder.responds_to_alexa_requests(params)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
21
34
|
end
|
22
35
|
|
23
36
|
# add your intent methods here like this:
|
24
37
|
# def example(alexa, slot1, slot2) etc...
|
25
|
-
|
38
|
+
# code here
|
26
39
|
# end'
|
27
40
|
|
28
|
-
|
29
|
-
|
30
|
-
|
41
|
+
|
42
|
+
sh " echo '#{string}' > 'app/controllers/intent_controller.rb'"
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
file "routes.rb" => "app/controllers" do
|
50
|
+
|
51
|
+
string2 = """
|
52
|
+
Rails.application.routes.draw do
|
53
|
+
|
54
|
+
root to: 'intent#intents'
|
55
|
+
post '/intents', to: 'intent#intents'
|
56
|
+
|
57
|
+
end"""
|
58
|
+
|
59
|
+
sh %Q! echo "#{string2}" > 'config/routes.rb'!
|
31
60
|
end
|
32
|
-
puts "Created file 'intent_controller'"
|
33
61
|
end
|
34
62
|
end
|
35
63
|
end
|