amazonecho 1.0.8 → 1.0.9

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/amazonecho/railtie.rb +43 -15
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 969dc42030969279e5d97b3b81da896b4cd63d95
4
- data.tar.gz: 7363e78d8cd92699fb290794b9bdeb1e460ce39c
3
+ metadata.gz: fcb3728073789c3e5fc11c0567460cb8f190c4ed
4
+ data.tar.gz: 2dff179a9f505645a73638055a1215f9e32af5e7
5
5
  SHA512:
6
- metadata.gz: 5956e272a18327008afe4252aef982b6114f05f83c1bbf219159a92f3d7c9e1f68bdc79981999004312340a4b7dd42e711bc1d82949514b9b526edd18e8adcc0
7
- data.tar.gz: 28d84a3928e9df92cce233f0112fbc2d1bb2888223a5581943fbff19c1bbc3e69b3cd28d042c7459be472cd7b37218fade064f29327fd443cfbb3e3d3a0e3859
6
+ metadata.gz: 8abb5b72d19f3ea6573e36f3efbc2cedf4b1d4d7819873dc1a78c84c71bf40f2c5f1b458d223e6db4580935ad66dc3ea018c7800bae71821b9589041f223e49a
7
+ data.tar.gz: a4d1ac26c4809d3a36c156fe784ed665c4716d93256341d5792e2b39d5399d255612d17a16644d7c8b67111f50e895550e186151a50ea97796af673f71aeef0e
@@ -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
- skip_before_action :verify_authenticity_token
12
- #Don`t forget to add all the Intent methods as helpers and to update your routes!
13
- #helper_method: example
14
- def intents
15
- respond_to do |format|
16
- format.json {
17
- render json: AlexaResponder.responds_to_alexa_requests(params)
18
- }
19
- end
20
- end
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
- # code here
38
+ # code here
26
39
  # end'
27
40
 
28
- file "build" => "app/controllers" do
29
- sh " echo '#{string}' > 'app/controllers/intent_controller.rb'"
30
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazonecho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Weingarten