codestrap 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +2 -2
  4. data/codestrap.gemspec +11 -2
  5. data/lib/codestrap.rb +96 -0
  6. data/lib/codestrap/cli.rb +11 -1
  7. data/lib/codestrap/config.rb +18 -8
  8. data/lib/codestrap/version.rb +1 -1
  9. metadata +47 -222
  10. data/.gitignore +0 -20
  11. data/.travis.yml +0 -4
  12. data/Gemfile +0 -6
  13. data/LICENSE.txt +0 -13
  14. data/Rakefile +0 -51
  15. data/config/projects/codestrap.rb +0 -22
  16. data/config/software/codestrap.rb +0 -20
  17. data/config/software/ruby.rb +0 -247
  18. data/config/software/zlib.rb +0 -86
  19. data/features/client.feature +0 -99
  20. data/features/fixtures/client/home/codestrap/bin/.empty +0 -0
  21. data/features/fixtures/client/home/codestrap/content/bash.erb +0 -3
  22. data/features/fixtures/client/home/codestrap/content/gem/dir/file +0 -0
  23. data/features/fixtures/client/home/codestrap/content/gem/dir/template +0 -3
  24. data/features/fixtures/client/home/codestrap/content/gem/file +0 -1
  25. data/features/fixtures/client/home/codestrap/content/gem/template +0 -3
  26. data/features/fixtures/client/home/codestrap/content/local_remote.erb +0 -1
  27. data/features/fixtures/client/home/codestrap/content/local_remote/dir/file +0 -0
  28. data/features/fixtures/client/home/codestrap/content/local_remote/dir/template +0 -3
  29. data/features/fixtures/client/home/codestrap/content/local_remote/file +0 -1
  30. data/features/fixtures/client/home/codestrap/content/local_remote/template +0 -3
  31. data/features/fixtures/client/home/codestrap/objects/local.json +0 -3
  32. data/features/fixtures/client/output/.empty +0 -0
  33. data/features/fixtures/client/var/lib/codestrap/bin/.empty +0 -0
  34. data/features/fixtures/client/var/lib/codestrap/content/bashremote.erb +0 -3
  35. data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/file +0 -0
  36. data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/template +0 -3
  37. data/features/fixtures/client/var/lib/codestrap/content/gemremote/file +0 -0
  38. data/features/fixtures/client/var/lib/codestrap/content/gemremote/template +0 -3
  39. data/features/fixtures/client/var/lib/codestrap/content/remote_local.erb +0 -1
  40. data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/file +0 -0
  41. data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/template +0 -3
  42. data/features/fixtures/client/var/lib/codestrap/content/remote_local/file +0 -1
  43. data/features/fixtures/client/var/lib/codestrap/content/remote_local/template +0 -3
  44. data/features/fixtures/client/var/lib/codestrap/content/remote_remote.erb +0 -1
  45. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/file +0 -0
  46. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/template +0 -3
  47. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/file +0 -0
  48. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/template +0 -3
  49. data/features/fixtures/client/var/lib/codestrap/objects/remote.json +0 -3
  50. data/features/fixtures/logging/home/logging/codestrap/bin/stubdirectory/.empty +0 -0
  51. data/features/fixtures/logging/home/logging/codestrap/bin/stubnotlink +0 -0
  52. data/features/fixtures/logging/home/logging/codestrap/content/.empty +0 -0
  53. data/features/fixtures/logging/home/logging/codestrap/objects/.empty +0 -0
  54. data/features/fixtures/server/mixed/var/lib/stub/content/address.erb +0 -3
  55. data/features/fixtures/server/mixed/var/lib/stub/content/cell.erb +0 -3
  56. data/features/fixtures/server/mixed/var/lib/stub/content/email.erb +0 -3
  57. data/features/fixtures/server/mixed/var/lib/stub/content/mobile.erb +0 -3
  58. data/features/fixtures/server/mixed/var/lib/stub/content/name.erb +0 -3
  59. data/features/fixtures/server/mixed/var/lib/stub/content/phone.erb +0 -3
  60. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/Modulefile +0 -12
  61. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/README +0 -17
  62. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/manifests/init.pp +0 -42
  63. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/spec/spec_helper.rb +0 -18
  64. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/tests/init.pp +0 -13
  65. data/features/fixtures/server/mixed/var/lib/stub/objects/contact.json +0 -8
  66. data/features/fixtures/server/mixed/var/lib/stub/objects/shadow/contact.json +0 -8
  67. data/features/fixtures/strap/projects/etc/.empty +0 -0
  68. data/features/fixtures/strap/projects/home/user/dir/bin/.empty +0 -0
  69. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/Modulefile +0 -12
  70. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/README +0 -17
  71. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/:stub:project.name:/subclass.pp +0 -3
  72. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/init.pp +0 -42
  73. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/spec/spec_helper.rb +0 -18
  74. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/tests/init.pp +0 -13
  75. data/features/fixtures/strap/projects/home/user/dir/objects/contact.json +0 -8
  76. data/features/fixtures/strap/projects/home/user/dir/objects/shadow/contact.json +0 -8
  77. data/features/fixtures/strap/projects/output/.empty +0 -0
  78. data/features/fixtures/stub/contact/etc/.empty +0 -0
  79. data/features/fixtures/stub/contact/home/user/dir/bin/.empty +0 -0
  80. data/features/fixtures/stub/contact/home/user/dir/content/address.erb +0 -3
  81. data/features/fixtures/stub/contact/home/user/dir/content/cell.erb +0 -3
  82. data/features/fixtures/stub/contact/home/user/dir/content/email.erb +0 -3
  83. data/features/fixtures/stub/contact/home/user/dir/content/mobile.erb +0 -3
  84. data/features/fixtures/stub/contact/home/user/dir/content/name.erb +0 -3
  85. data/features/fixtures/stub/contact/home/user/dir/content/phone.erb +0 -3
  86. data/features/fixtures/stub/contact/home/user/dir/objects/contact.json +0 -8
  87. data/features/fixtures/stub/contact/home/user/dir/objects/shadow/contact.json +0 -8
  88. data/features/fixtures/stub/contact/output/.empty +0 -0
  89. data/features/fixtures/stub/date/etc/.empty +0 -0
  90. data/features/fixtures/stub/date/home/user/stub/bin/.empty +0 -0
  91. data/features/fixtures/stub/date/home/user/stub/content/day.erb +0 -3
  92. data/features/fixtures/stub/date/home/user/stub/content/hour.erb +0 -3
  93. data/features/fixtures/stub/date/home/user/stub/content/minute.erb +0 -3
  94. data/features/fixtures/stub/date/home/user/stub/content/month.erb +0 -3
  95. data/features/fixtures/stub/date/home/user/stub/content/second.erb +0 -3
  96. data/features/fixtures/stub/date/home/user/stub/content/year.erb +0 -3
  97. data/features/fixtures/stub/date/home/user/stub/objects/.empty +0 -0
  98. data/features/fixtures/stub/date/output/.empty +0 -0
  99. data/features/fixtures/stub/script/etc/.empty +0 -0
  100. data/features/fixtures/stub/script/home/user/stub/bin/.empty +0 -0
  101. data/features/fixtures/stub/script/home/user/stub/content/credentials.erb +0 -6
  102. data/features/fixtures/stub/script/home/user/stub/objects/credentials.rb +0 -11
  103. data/features/fixtures/stub/script/output/.empty +0 -0
  104. data/features/logging.feature +0 -39
  105. data/features/object_scripts.feature +0 -13
  106. data/features/server.feature +0 -36
  107. data/features/step_definitions/client_steps.rb +0 -99
  108. data/features/step_definitions/logging_steps.rb +0 -65
  109. data/features/step_definitions/object_scripts_steps.rb +0 -26
  110. data/features/step_definitions/server_steps.rb +0 -112
  111. data/features/step_definitions/strap_steps.rb +0 -69
  112. data/features/step_definitions/stub_option_simple_steps.rb +0 -31
  113. data/features/step_definitions/stub_steps.rb +0 -94
  114. data/features/strap.feature +0 -34
  115. data/features/stub.feature +0 -157
  116. data/features/stub_option_simple.feature +0 -14
  117. data/features/stub_packages.feature +0 -15
  118. data/features/support/env.rb +0 -197
  119. data/omnibus.rb +0 -53
  120. data/package-scripts/codestrap/postinst +0 -25
  121. data/package-scripts/codestrap/postrm +0 -17
  122. data/package-scripts/codestrap/preinst +0 -7
  123. data/package-scripts/codestrap/prerm +0 -15
  124. data/resources/codestrap/pkg/background.png +0 -0
  125. data/resources/codestrap/pkg/distribution.xml.erb +0 -22
  126. data/resources/codestrap/pkg/license.html.erb +0 -202
  127. data/resources/codestrap/pkg/welcome.html.erb +0 -7
@@ -1,14 +0,0 @@
1
- Feature: strap --help and --version
2
- Command supports the help and version options
3
-
4
- Scenario Outline: Simple options
5
- When the command "strap" with option "<simple_option>" is executed
6
- Then the option output is greater then 0 bytes
7
- And the option option exit status should be 0
8
- Examples: help
9
- | simple_option |
10
- | --help |
11
- | -h |
12
- | -? |
13
- | -v |
14
- | --version |
@@ -1,15 +0,0 @@
1
- Feature: Package management
2
- As a user, I will utilize a package, codestrap, modules manager for templates
3
- to download available packages from a package server(s).
4
-
5
- Scenario Outline: Package management
6
- Given test "<data>" set
7
- And environment variables
8
- When command "<command>" is executed
9
- And input
10
- Then a set of are created
11
- And output has the right contents and format
12
- And error has the right contents and format
13
- And exit code has expected values
14
- Examples:
15
- | data | command |
@@ -1,197 +0,0 @@
1
- require 'cucumber'
2
- require 'find'
3
- require 'fileutils'
4
- require 'json'
5
- require 'rack/test'
6
- require 'rspec/expectations'
7
- require 'codestrap'
8
- require 'codestrap/version'
9
- require 'codestrap/server/rest'
10
- require 'stringio'
11
- require 'tempfile'
12
- require 'tmpdir'
13
- require 'webmock/cucumber'
14
- require 'yaml'
15
-
16
- ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
17
- FIXTURE_ROOT = File.join(ROOT, 'features', 'fixtures')
18
- BINDIR = File.join(ROOT, 'bin')
19
- TMPDIR = File.join(ROOT, 'tmp')
20
- FIXTURES = %W[stub strap server client logging]
21
-
22
- $LOAD_PATH.unshift File.join(ROOT, 'lib')
23
-
24
- Codestrap::Server::Rest.set :environment => :development
25
-
26
- class MyWorld
27
- include Rack::Test::Methods
28
-
29
- def app
30
- @app = Rack::Builder.new do
31
- run Codestrap::Server::Rest
32
- end
33
- end
34
- end
35
-
36
- World do
37
- MyWorld.new
38
- end
39
-
40
- def diff_tree?(left, right)
41
- left_tree = []
42
- Dir.chdir(left) do
43
- left_tree = Dir.glob('**').sort { |a,b| a.length <=> b.length }
44
- end
45
- right_tree = []
46
- Dir.chdir(right) do
47
- right_tree = Dir.glob('**').sort { |a,b| a.length <=> b.length }
48
- end
49
-
50
- if left_tree != right_tree
51
- return 1
52
- end
53
-
54
- left_tree.each do |file|
55
- left_file = File.join(left, file)
56
- right_file = File.join(right, file)
57
- left_stat = File::Stat.new(left_file)
58
- right_stat = File::Stat.new(right_file)
59
- if left_stat.ftype != right_stat.ftype
60
- return 1
61
- end
62
- next if left_stat.directory?
63
- unless FileUtils.compare_file(left_file, right_file)
64
- return 1
65
- end
66
- end
67
-
68
- 0
69
- end
70
-
71
- # Capture cli methods
72
- module Capture
73
- class Cli
74
- # Get & Set
75
- attr_reader :object_exit
76
- attr_reader :stdout
77
- attr_reader :stderr
78
-
79
- def object_exit= object_exit
80
- raise TypeError, %q[expecting type SystemExit] unless object_exit.is_a?(SystemExit)
81
- @object_exit = object_exit
82
- end
83
-
84
- def initialize(divertstdout=true, divertstderr=false)
85
- @stdout ||= String.new
86
- @stderr ||= String.new
87
- @divertstdout = divertstdout
88
- @divertsterr = divertstderr
89
- end
90
-
91
- def inline
92
- begin
93
- if @divertstdout
94
- @origstdout = $stdout
95
- $stdout = StringIO.new(@stdout)
96
- end
97
- if @divertstderr
98
- @origstderr = $stderr
99
- $stderr = StringIO.new(@stderr)
100
- end
101
- yield
102
- rescue SystemExit => e
103
- self.object_exit = e
104
- ensure
105
- $stdout = @origstdout if @divertstdout
106
- $stderr = @origstderr if @divertsterr
107
- end
108
- self
109
- end
110
-
111
- def self.inline
112
- Capture::Cli.new().inline do
113
- yield
114
- end
115
- end
116
- end
117
- end
118
-
119
- module Tools
120
- class Cli
121
- def initialize
122
- @env_original = ENV['PATH']
123
- end
124
-
125
- def path_unshift path
126
- unless ENV['PATH'].split(':').include?(path.to_s)
127
- ENV['PATH'] = "#{path}:#{ENV['PATH']}"
128
- end
129
- end
130
-
131
- def path_reset
132
- ENV['PATH'] = @env_original
133
- end
134
- end
135
- class Test
136
- def self.list_tree(project)
137
- Find.find(project).map { |dir| dir.gsub(/#{Regexp.escape(project)}/, '') }
138
- end
139
-
140
- def self.contents(test_hash)
141
- test_hash.each_pair do |file, tests|
142
- content = File.read(File.join(file))
143
- tests.each_pair do |str, bool|
144
- yield content, str, bool
145
- end
146
- end
147
- end
148
- end
149
- end
150
-
151
- module JSON
152
- def self.is_json?(foo)
153
- begin
154
- return false unless foo.is_a?(String)
155
- JSON.parse(foo).all?
156
- rescue JSON::ParserError
157
- false
158
- end
159
- end
160
- end
161
-
162
- Before do
163
- # Web mock
164
- WebMock.allow_net_connect!
165
- stub_request(:any, /127.0.0.1/).to_rack(Codestrap::Server::Rest)
166
-
167
- # Copy fixures to tmp/
168
- FIXTURES.each do |dir|
169
- fixture = File.join(FIXTURE_ROOT, dir)
170
- newpath = File.join(TMPDIR, dir)
171
- cmd = File.join(BINDIR, 'strap')
172
- next unless File.exist? fixture
173
- FileUtils.cp_r fixture, TMPDIR
174
- Dir.glob("#{newpath}/**/bin").each do |path|
175
- stub = File.join(path, 'stub')
176
- strap = File.join(path, 'strap')
177
- FileUtils.cp cmd, strap unless File.exist? strap
178
- FileUtils.ln_s strap, stub unless File.exist? stub
179
- end
180
- end
181
-
182
- # Set path
183
- @testtools = Tools::Cli.new()
184
-
185
- # Project temporary directory
186
- @tmpdir = TMPDIR
187
-
188
- # Current directory
189
- @curdir = Dir.getwd
190
-
191
- # Original environment variable
192
- Dir.chdir @tmpdir
193
- end
194
-
195
- After do
196
- Dir.chdir @curdir
197
- end
data/omnibus.rb DELETED
@@ -1,53 +0,0 @@
1
- #
2
- # This file is used to configure the codestrap project. It contains
3
- # some minimal configuration examples for working with Omnibus. For a full list
4
- # of configurable options, please see the documentation for +omnibus/config.rb+.
5
- #
6
-
7
- # Build internally
8
- # ------------------------------
9
- # By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
10
- # cache components. If you would to build everything internally, you can
11
- # uncomment the following options. This will prevent the need for root
12
- # permissions in most cases.
13
- #
14
- # Uncomment this line to change the default base directory to "local"
15
- # -------------------------------------------------------------------
16
- # base_dir './local'
17
- #
18
- # Alternatively you can tune the individual values
19
- # ------------------------------------------------
20
- # cache_dir './local/omnibus/cache'
21
- # git_cache_dir './local/omnibus/cache/git_cache'
22
- # source_dir './local/omnibus/src'
23
- # build_dir './local/omnibus/build'
24
- # package_dir './local/omnibus/pkg'
25
- # package_tmp './local/omnibus/pkg-tmp'
26
-
27
- # Disable git caching
28
- # ------------------------------
29
- # use_git_caching false
30
-
31
- # Enable S3 asset caching
32
- # ------------------------------
33
- # use_s3_caching true
34
- # s3_access_key ENV['AWS_ACCESS_KEY_ID']
35
- # s3_secret_key ENV['AWS_SECRET_ACCESS_KEY']
36
- # s3_bucket ENV['AWS_S3_BUCKET']
37
-
38
- # Customize compiler bits
39
- # ------------------------------
40
- # solaris_compiler 'gcc'
41
- # build_retries 5
42
- # fetcher_read_timeout 120
43
- # fetcher_retries 5
44
-
45
- # Load additional software
46
- # ------------------------------
47
- # software_gems ['omnibus-software', 'my-company-software']
48
- # local_software_dirs ['/path/to/local/software']
49
-
50
- # Windows architecture defaults
51
- # ------------------------------
52
- windows_arch %w{x86 x64}.include?((ENV['OMNIBUS_WINDOWS_ARCH'] || '').downcase) ?
53
- ENV['OMNIBUS_WINDOWS_ARCH'].downcase.to_sym : :x86
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # Perform necessary codestrap setup steps
4
- # after package is installed.
5
- #
6
-
7
- PROGNAME=`basename $0`
8
-
9
- error_exit()
10
- {
11
- echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
12
- exit 1
13
- }
14
-
15
- if [ ! -d /usr/local/bin ]; then
16
- mkdir -p /usr/local/bin
17
- fi
18
-
19
- # Create the symlink so that codestrap is available in PATH
20
- ln -Fs $2/bin/strap /usr/local/bin/strap
21
- #ln -Fs $2/bin/upstrap /usr/local/bin/upstrap
22
-
23
- echo "Thank you for installing codestrap!"
24
-
25
- exit 0
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- #
3
- # Perform necessary codestrap removal steps
4
- # after package is uninstalled.
5
- #
6
-
7
- for link in strap upstrap
8
- do
9
- if [ -f /usr/local/bin/${link} ]
10
- then
11
- unlink /usr/local/bin/${link}
12
- fi
13
- done
14
-
15
- echo "codestrap has been uninstalled!"
16
-
17
- exit 0
@@ -1,7 +0,0 @@
1
- #!/bin/sh
2
- #
3
- # Perform necessary codestrap setup steps
4
- # before package is installed.
5
- #
6
-
7
- echo "You're about to install codestrap!"
@@ -1,15 +0,0 @@
1
- #!/bin/sh
2
- #
3
- # Perform necessary codestrap setup steps
4
- # prior to installing package.
5
- #
6
-
7
- PROGNAME=`basename $0`
8
-
9
- error_exit()
10
- {
11
- echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
12
- exit 1
13
- }
14
-
15
- exit 0
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <installer-gui-script minSpecVersion="1">
3
- <title><%= friendly_name %></title>
4
- <background file="background.png" alignment="bottomleft" mime-type="image/png"/>
5
- <welcome file="welcome.html" mime-type="text/html"/>
6
- <license file="license.html" mime-type="text/html"/>
7
-
8
- <!-- Generated by productbuild - - synthesize -->
9
- <pkg-ref id="<%= identifier %>"/>
10
- <options customize="never" require-scripts="false"/>
11
- <choices-outline>
12
- <line choice="default">
13
- <line choice="<%= identifier %>"/>
14
- </line>
15
- </choices-outline>
16
- <choice id="default"/>
17
- <choice id="<%= identifier %>" visible="false">
18
- <pkg-ref id="<%= identifier %>"/>
19
- </choice>
20
- <pkg-ref id="<%= identifier %>" version="<%= version %>" onConclusion="none"><%= component_pkg %></pkg-ref>
21
- <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true" />
22
- </installer-gui-script>
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright 2014 <%= maintainer %>
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.