zendesk_apps_tools 1.8.0 → 1.9.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: 58cbebaeeee200b0db8ead6cbeffc425dec1a394
4
- data.tar.gz: 6474700092a46dfca452f9a58f3805955035d028
3
+ metadata.gz: 6acdb26a9908ab70af045d8f6ad781a500fefd65
4
+ data.tar.gz: 187552d8ccf957e944edca4c256cf86cfa416816
5
5
  SHA512:
6
- metadata.gz: 81fdca0acd54cbfb5b1ec39d59e10566d3c6a447fd89bf20d655e92677c02d611d8efe4fc677684075ff4c3c9389f3b49f4d80a9867b692f4c98c654a3b61356
7
- data.tar.gz: d67444c03deee64316a8894f81a6befebe6f6fadf2db7b6c527171efcf5b7c2f5f53ead665f6e8013b574a46bd0aead3d446375b3a1ba1c1bf49d0871ba2724f
6
+ metadata.gz: 6cea64bcd79091ebaefe815ab2927f1e3a0a6f9c432e6dc54e8c37f8bf66bc4e9c360fb9f611c32142a3f20da59599a1e0ba86e3b8ed4e7c2c3318ff129c3a7d
7
+ data.tar.gz: 6eb16f0f532f6678fd7d96230630c07b4097e49c0ff8ad039be1066db74b263b316d2b257152dc999bbaff73db127239b25e9d7234ee371bb0a11a45c8edfd00
@@ -0,0 +1,15 @@
1
+ # App name
2
+
3
+ [brief description of the app]
4
+
5
+ ### The following information is displayed:
6
+
7
+ * info1
8
+ * info2
9
+ * info3
10
+
11
+ Please submit bug reports to [Insert Link](). Pull requests are welcome.
12
+
13
+ ### Screenshot(s):
14
+ [put your screenshots down here.]
15
+
@@ -13,3 +13,10 @@ Feature: package a zendesk app into a zip file
13
13
  And the command output should contain "adding translations/en.json"
14
14
  And the command output should contain "created"
15
15
  And the zip file should exist in directory "tmp/aruba/tmp"
16
+
17
+
18
+ Scenario: package a zendesk app by running 'zat package' command
19
+ When I create a symlink from "./templates/translation.erb.tt" to "tmp/aruba/assets/translation.erb.tt"
20
+ Then "tmp/aruba/assets/translation.erb.tt" should be a symlink
21
+ When I run the command "zat package --path tmp/aruba" to package the app
22
+ Then the zip file in "tmp/aruba/tmp" should not contain any symlinks
@@ -1,4 +1,5 @@
1
1
  require 'fileutils'
2
+ require 'zip/zip'
2
3
 
3
4
  When /^I move to the app directory$/ do
4
5
  @previous_dir = Dir.pwd
@@ -38,6 +39,12 @@ When /^I run "(.*?)" command with the following details:$/ do |cmd, table|
38
39
  end
39
40
  end
40
41
 
42
+ When /^I create a symlink from "(.*?)" to "(.*?)"$/ do |src, dest|
43
+ @link_destname = File.basename(dest)
44
+ # create a symlink
45
+ FileUtils.ln_s(src, dest)
46
+ end
47
+
41
48
  When /^I run the command "(.*?)" to (validate|package|clean) the app$/ do |cmd, action|
42
49
  IO.popen(cmd, "w+") do |pipe|
43
50
  pipe.puts "\n"
@@ -83,3 +90,13 @@ end
83
90
  Then /^the command output should contain "(.*?)"$/ do |output|
84
91
  @output.join.should =~ /#{output}/
85
92
  end
93
+
94
+ Then /^"(.*?)" should be a symlink$/ do |path|
95
+ File.symlink?(path).should be_true
96
+ end
97
+
98
+ Then /^the zip file in "(.*?)" should not contain any symlinks$/ do |path|
99
+ Zip::ZipFile.foreach Dir[path+'/app-*.zip'][0] do |p|
100
+ p.symlink?.should be_false
101
+ end
102
+ end
@@ -89,8 +89,14 @@ module ZendeskAppsTools
89
89
 
90
90
  Zip::ZipFile.open(archive_path, 'w') do |zipfile|
91
91
  app_package.files.each do |file|
92
- say_status "package", "adding #{file.relative_path}"
93
- zipfile.add(file.relative_path, app_dir.join(file.relative_path).to_s)
92
+ path = file.relative_path
93
+ say_status "package", "adding #{path}"
94
+
95
+ # resolve symlink to source path
96
+ if File.symlink? file.absolute_path
97
+ path = File.readlink(file.absolute_path)
98
+ end
99
+ zipfile.add(file.relative_path, app_dir.join(path).to_s)
94
100
  end
95
101
  end
96
102
 
@@ -16,15 +16,24 @@ module ZendeskAppsTools
16
16
  input = user_input.get_value_from_stdin("Enter a value for optional parameter '#{param[:name]}' or press 'Return' to skip:\n", :allow_empty => true)
17
17
  end
18
18
 
19
- unless input.empty?
20
- input = (input =~ /^(true|t|yes|y|1)$/i) ? true : false if param[:type] == 'checkbox'
21
- settings[param[:name]] = input
19
+ if param[:type] == 'checkbox'
20
+ input = convert_to_boolean_for_checkbox(input)
22
21
  end
23
22
 
23
+ settings[param[:name]] = input if input != ''
24
24
  settings
25
25
  end
26
26
  end
27
27
 
28
+ private
29
+
30
+ def convert_to_boolean_for_checkbox(input)
31
+ if ![TrueClass, FalseClass].include?(input.class)
32
+ return (input =~ /^(true|t|yes|y|1)$/i) ? true : false
33
+ end
34
+ input
35
+ end
36
+
28
37
  end
29
38
  end
30
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-12-02 00:00:00.000000000 Z
14
+ date: 2013-12-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 1.8.0
78
+ version: 1.9.0
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: 1.8.0
85
+ version: 1.9.0
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: cucumber
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +161,7 @@ files:
161
161
  - app_template/assets/logo.png
162
162
  - app_template/assets/promotion-image.png
163
163
  - app_template/manifest.json.tt
164
+ - app_template/README.md
164
165
  - app_template/templates/layout.hdbs
165
166
  - app_template/translations/en.json
166
167
  - templates/translation.erb.tt
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  version: 1.3.6
194
195
  requirements: []
195
196
  rubyforge_project:
196
- rubygems_version: 2.0.3
197
+ rubygems_version: 2.0.14
197
198
  signing_key:
198
199
  specification_version: 4
199
200
  summary: Tools to help you develop Zendesk Apps.