alexa_plugin_generator 0.1.4 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc84a38758eb72fd36b2e0ed7a52ffb36af3ed62
4
- data.tar.gz: 22782fb42029dade63b2e82ed101d375afdaf90a
3
+ metadata.gz: c022b93dd013e08bb600f5c64615e462161068c5
4
+ data.tar.gz: 0476de460cb60a1649b778b305ea93a0e30ad175
5
5
  SHA512:
6
- metadata.gz: fe2ff8ba96e85089d843ebd599095174000337a70825e9f5d6d434a78357936594e59be4fc3c826cd533e37c83591a7a84cc9bda5208d0b933eaff363e530c06
7
- data.tar.gz: 901024690b0c7cb84b66cc5da106f2ab9ba4ab1c3bb85abfe05b11ba309540860d4426541f4ac026115481f3cf01d4c936e31fabf56286263997c9c5da4f1592
6
+ metadata.gz: 31619d633ab457b2025138c045e0a65622d6c30a0a38c17dd17c414ea2871cbaed2b67c1f73dea4e71c13190f92a91da7c5c56cc36dcc96718e62108a4c7ed7a
7
+ data.tar.gz: 9c0fe79b08c3487ca964bafc3b4dd01bc4d9754816d161fd521c7bc711fbc59e57d84ea1fe0f0383dbad132baad62147a9762408df7ad078dfb1d2ea716172b7
@@ -3,19 +3,17 @@ require 'active_support/core_ext/string'
3
3
 
4
4
  module AlexaPluginGenerator
5
5
  class HammerOfTheGods < Thor
6
- desc "hello NAME", "This will greet you"
7
- long_desc <<-HELLO_WORLD
6
+ desc "new NAME", "Will create all files need to build a SingingAssistant alexa plugin."
7
+ long_desc <<-ALEXA_PLUGIN_GENERATOR
8
8
 
9
- `hello NAME` will print out a message to the person of your choosing.
9
+ `new NAME` will create all files to build a SingingAssitant alexa plugin.
10
10
 
11
- Brian Kernighan actually wrote the first "Hello, World!" program
12
- as part of the documentation for the BCPL programming language
13
- developed by Martin Richards. BCPL was used while C was being
14
- developed at Bell Labs a few years before the publication of
15
- Kernighan and Ritchie's C book in 1972.
11
+ All you need to do is define the methods that match up to the intent name of your
12
+ action. You will also need to define your sample_utterances, custom_slots and intent_schema
13
+ for your alexa skill.
16
14
 
17
- http://stackoverflow.com/a/12785204
18
- HELLO_WORLD
15
+ http://github.com/kylegrantlucas/alexa_plugin_generator
16
+ ALEXA_PLUGIN_GENERATOR
19
17
  def new( name )
20
18
  name = name[6..-1] if name[0..5] == "alexa_"
21
19
  gemname = "alexa_#{name}"
@@ -32,18 +30,18 @@ module AlexaPluginGenerator
32
30
  file.split("\n").each_with_index do |line, index|
33
31
  line_number = index+1
34
32
  if filename == "lib/#{gemname}.rb"
35
- if line_number == 2
36
- new_file << "require 'sinatra/base'\n"
33
+ if line_number == 1
34
+ new_file << "require 'sinatra/extension'\n"
37
35
  new_file << "require 'alexa_objects'\n\n"
38
36
  elsif line_number == 3
39
- new_file << "module Siantra\n"
40
- new_file << " module #{name.camelize}\n"
41
- new_file << " def self.registered(app)\n"
42
- new_file << " app.post '/#{gemname}' do\n"
43
- new_file << " end\n"
37
+ new_file << "module #{name.camelize}\n"
38
+ new_file << " extend Sinatra::Extension\n\n"
39
+ new_file << " helpers do\n"
40
+ new_file << " # TODO: Change to new intent name\n"
41
+ new_file << " def intent_name\n"
42
+ new_file << " # TODO: Implement intent\n"
44
43
  new_file << " end\n"
45
- new_file << " end\n\n"
46
- new_file << " register #{name.camelize}\n"
44
+ new_file << " end\n"
47
45
  new_file << "end\n"
48
46
  elsif line_number == 4
49
47
  elsif line_number == 5
@@ -53,8 +51,8 @@ module AlexaPluginGenerator
53
51
  end
54
52
  elsif filename == "#{gemname}.gemspec"
55
53
  if line_number == 24
56
- new_file << " spec.add_dependency 'sinatra'\n"
57
- new_file << " spec.add_dependency 'alexa_objects'\n\n"
54
+ new_file << " spec.add_runtime_dependency 'sinatra-contrib'\n"
55
+ new_file << " spec.add_runtime_dependency 'alexa_objects'\n\n"
58
56
  elsif line_number == 28
59
57
  new_file << "#{line[0...-1]}, \"skills_config\"]\n"
60
58
  elsif line_number.between?(17, 23)
@@ -75,29 +73,15 @@ module AlexaPluginGenerator
75
73
  puts "Created ./#{gemname}/skills_config/#{skill_file}.txt" if system "touch ./#{gemname}/skills_config/#{skill_file}.txt"
76
74
 
77
75
  file = File.open("./#{gemname}/lib/#{gemname}/#{skill_file}.rb", 'w') do |file|
78
- file << "module Sinatra\n"
79
- file << " module #{name.camelize}\n"
80
- file << " def self.#{skill_file}\n"
81
- file << " File.read(File.expand_path('../../../skills_config/#{skill_file}.txt', __FILE__))\n"
82
- file << " end\n"
76
+ file << "module #{name.camelize}\n"
77
+ file << " def self.#{skill_file}\n"
78
+ file << " File.read(File.expand_path('../../../skills_config/#{skill_file}.txt', __FILE__))\n"
83
79
  file << " end\n"
84
80
  file << "end\n"
85
81
  end
86
82
 
87
83
  puts "Created ./#{gemname}/lib/#{gemname}/#{skill_file}.rb" if file
88
84
  end
89
-
90
- file = File.open("./#{gemname}/lib/#{gemname}/endpoint.rb", 'w') do |file|
91
- file << "module Sinatra\n"
92
- file << " module #{name.camelize}\n"
93
- file << " def self.endpoint\n"
94
- file << " '/alexa_#{gemname}'\n"
95
- file << " end\n"
96
- file << " end\n"
97
- file << "end\n"
98
- end
99
-
100
- puts "Created ./#{gemname}/lib/#{gemname}/endpoint.rb" if file
101
85
  end
102
86
  end
103
87
  end
@@ -1,3 +1,3 @@
1
1
  module AlexaPluginGenerator
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_plugin_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kylegrantlucas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-14 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -130,3 +130,4 @@ signing_key:
130
130
  specification_version: 4
131
131
  summary: A command line tool for generating singing_assistant middleware templates.
132
132
  test_files: []
133
+ has_rdoc: