workarea-worldpay_xml 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.gitignore +19 -0
  7. data/.rails-rubocop.yml +130 -0
  8. data/.rubocop.yml +14 -0
  9. data/CHANGELOG.md +21 -0
  10. data/CODE_OF_CONDUCT.md +3 -0
  11. data/CONTRIBUTING.md +3 -0
  12. data/Gemfile +10 -0
  13. data/LICENSE +52 -0
  14. data/README.md +63 -0
  15. data/Rakefile +60 -0
  16. data/app/models/workarea/payment/authorize/credit_card.decorator +36 -0
  17. data/app/models/workarea/payment/credit_card_data.rb +48 -0
  18. data/app/models/workarea/payment/purchase/credit_card.decorator +36 -0
  19. data/app/models/workarea/payment/refund/credit_card.decorator +28 -0
  20. data/app/models/workarea/payment/store_credit_card.decorator +27 -0
  21. data/app/models/workarea/payment/tender/credit_card.decorator +7 -0
  22. data/bin/rails +20 -0
  23. data/config/initializers/workarea.rb +1 -0
  24. data/lib/active_merchant/billing/bogus_worldpay_gateway.rb +65 -0
  25. data/lib/active_merchant/billing/worldpay_tokenize.rb +118 -0
  26. data/lib/workarea/worldpay_xml.rb +48 -0
  27. data/lib/workarea/worldpay_xml/engine.rb +8 -0
  28. data/lib/workarea/worldpay_xml/version.rb +5 -0
  29. data/test/dummy/Rakefile +6 -0
  30. data/test/dummy/app/assets/config/manifest.js +4 -0
  31. data/test/dummy/app/assets/images/.keep +0 -0
  32. data/test/dummy/app/assets/javascripts/application.js +13 -0
  33. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  34. data/test/dummy/app/controllers/application_controller.rb +3 -0
  35. data/test/dummy/app/controllers/concerns/.keep +0 -0
  36. data/test/dummy/app/helpers/application_helper.rb +2 -0
  37. data/test/dummy/app/jobs/application_job.rb +2 -0
  38. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  39. data/test/dummy/app/models/concerns/.keep +0 -0
  40. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  42. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  43. data/test/dummy/bin/bundle +3 -0
  44. data/test/dummy/bin/rails +4 -0
  45. data/test/dummy/bin/rake +4 -0
  46. data/test/dummy/bin/setup +30 -0
  47. data/test/dummy/bin/update +26 -0
  48. data/test/dummy/bin/yarn +11 -0
  49. data/test/dummy/config.ru +5 -0
  50. data/test/dummy/config/application.rb +31 -0
  51. data/test/dummy/config/boot.rb +5 -0
  52. data/test/dummy/config/cable.yml +10 -0
  53. data/test/dummy/config/environment.rb +5 -0
  54. data/test/dummy/config/environments/development.rb +51 -0
  55. data/test/dummy/config/environments/production.rb +88 -0
  56. data/test/dummy/config/environments/test.rb +44 -0
  57. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  58. data/test/dummy/config/initializers/assets.rb +14 -0
  59. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  60. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  61. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  62. data/test/dummy/config/initializers/inflections.rb +16 -0
  63. data/test/dummy/config/initializers/mime_types.rb +4 -0
  64. data/test/dummy/config/initializers/workarea.rb +5 -0
  65. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  66. data/test/dummy/config/locales/en.yml +33 -0
  67. data/test/dummy/config/puma.rb +56 -0
  68. data/test/dummy/config/routes.rb +5 -0
  69. data/test/dummy/config/secrets.yml +32 -0
  70. data/test/dummy/config/spring.rb +6 -0
  71. data/test/dummy/db/seeds.rb +2 -0
  72. data/test/dummy/lib/assets/.keep +0 -0
  73. data/test/dummy/log/.keep +0 -0
  74. data/test/dummy/package.json +5 -0
  75. data/test/models/workarea/payment/authorize/credit_card_test.decorator +40 -0
  76. data/test/models/workarea/payment/capture_test.decorator +10 -0
  77. data/test/models/workarea/payment/credit_card_integration_test.decorator +24 -0
  78. data/test/models/workarea/payment/purchase/credit_card_test.decorator +25 -0
  79. data/test/models/workarea/payment/refund/credit_card_test.decorator +24 -0
  80. data/test/models/workarea/payment/refund_test.decorator +10 -0
  81. data/test/models/workarea/payment/store_credit_card_test.decorator +11 -0
  82. data/test/teaspoon_env.rb +6 -0
  83. data/test/test_helper.rb +10 -0
  84. data/test/workers/workarea/send_refund_email_test.decorator +29 -0
  85. data/workarea-worldpay_xml.gemspec +17 -0
  86. metadata +141 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 52f5ac69d68f49749ecf49d7f872ff6f7312c6000d80b224d971ff3b08f5559c
4
+ data.tar.gz: 3ddd6ae85cd551fa784a76977bf4dc12e57f1ad48b5a3d96574f9238386e68df
5
+ SHA512:
6
+ metadata.gz: 6627bb0517a264eb39906d92e61a838816b9de487d4fbf091ad8ec2a24c8a8d46807337ac838eaf7f1f04f38173e8c316b13f6b056c6d0e89c60ff11158d0dca
7
+ data.tar.gz: 0f03d3034365751c48dd7250778d1ac833e195d2c86638f8dfbb53b9619d3ba4253ba8ed022d7c29a6002bc78a937640422ca462f58f97312f55d1a364386335
@@ -0,0 +1,20 @@
1
+ # editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ end_of_line = lf
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [{*.rb,*.haml,*.decorator,*.yml,*.yaml,*.jbuilder}]
12
+ indent_size = 2
13
+ indent_style = space
14
+
15
+ [{*.js,*.jst,*.ejs,*.scss}]
16
+ indent_size = 4
17
+
18
+ [*.md]
19
+ indent_size = 4
20
+ trim_trailing_whitespace = false
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve Workarea
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ⚠️**Before you create**⚠️
11
+ Please verify the issue you're experiencing is not part of your Workarea project customizations. The best way to do this is with a [vanilla Workarea installation](https://developer.workarea.com/articles/create-a-new-host-application.html). This will help us spend time on fixes/improvements for the whole community. Thank you!
12
+
13
+ **Describe the bug**
14
+ A clear and concise description of what the bug is.
15
+
16
+ **To Reproduce**
17
+ Steps to reproduce the behavior:
18
+ 1. Go to '...'
19
+ 2. Click on '....'
20
+ 3. Scroll down to '....'
21
+ 4. See error
22
+
23
+ **Expected behavior**
24
+ A clear and concise description of what you expected to happen.
25
+
26
+ **Workarea Setup (please complete the following information):**
27
+ - Workarea Version: [e.g. v3.4.6]
28
+ - Plugins [e.g. workarea-blog, workarea-sitemaps]
29
+
30
+ **Attachments**
31
+ If applicable, add any attachments to help explain your problem, things like:
32
+ - screenshots
33
+ - Gemfile.lock
34
+ - test cases
35
+
36
+ **Additional context**
37
+ Add any other context about the problem here.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Documentation request
3
+ about: Suggest documentation
4
+ title: ''
5
+ labels: documentation
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your documentation related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm confused by [...]
12
+
13
+ **Describe the article you'd like**
14
+ A clear and concise description of what would be in the documentation article.
15
+
16
+ **Additional context**
17
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for Workarea
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,19 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/db/*.sqlite3
5
+ test/dummy/db/*.sqlite3-journal
6
+ test/dummy/log/*.log
7
+ test/dummy/tmp/
8
+ .DS_Store
9
+ .byebug_history
10
+ .bundle/
11
+ .sass-cache/
12
+ Gemfile.lock
13
+ pkg/
14
+ test/dummy/tmp/
15
+ test/dummy/public/
16
+ log/*.log
17
+ test/dummy/log/*.log
18
+ test/dummy/db/*.sqlite3
19
+ test/dummy/db/*.sqlite3-journal
@@ -0,0 +1,130 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ # Prefer &&/|| over and/or.
5
+ Style/AndOr:
6
+ Enabled: true
7
+
8
+ # Do not use braces for hash literals when they are the last argument of a
9
+ # method call.
10
+ Style/BracesAroundHashParameters:
11
+ Enabled: true
12
+ EnforcedStyle: context_dependent
13
+
14
+ # Align `when` with `case`.
15
+ Layout/CaseIndentation:
16
+ Enabled: true
17
+
18
+ # Align comments with method definitions.
19
+ Layout/CommentIndentation:
20
+ Enabled: true
21
+
22
+ Layout/EmptyLineAfterMagicComment:
23
+ Enabled: true
24
+
25
+ # In a regular class definition, no empty lines around the body.
26
+ Layout/EmptyLinesAroundClassBody:
27
+ Enabled: true
28
+
29
+ # In a regular method definition, no empty lines around the body.
30
+ Layout/EmptyLinesAroundMethodBody:
31
+ Enabled: true
32
+
33
+ # In a regular module definition, no empty lines around the body.
34
+ Layout/EmptyLinesAroundModuleBody:
35
+ Enabled: true
36
+
37
+ Layout/FirstParameterIndentation:
38
+ Enabled: true
39
+
40
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
41
+ Style/HashSyntax:
42
+ Enabled: true
43
+
44
+ # Method definitions after `private` or `protected` isolated calls need one
45
+ # extra level of indentation.
46
+ Layout/IndentationConsistency:
47
+ Enabled: true
48
+ EnforcedStyle: rails
49
+
50
+ # Two spaces, no tabs (for indentation).
51
+ Layout/IndentationWidth:
52
+ Enabled: true
53
+
54
+ Layout/SpaceAfterColon:
55
+ Enabled: true
56
+
57
+ Layout/SpaceAfterComma:
58
+ Enabled: true
59
+
60
+ Layout/SpaceAroundEqualsInParameterDefault:
61
+ Enabled: true
62
+
63
+ Layout/SpaceAroundKeyword:
64
+ Enabled: true
65
+
66
+ Layout/SpaceAroundOperators:
67
+ Enabled: true
68
+
69
+ Layout/SpaceBeforeFirstArg:
70
+ Enabled: true
71
+
72
+ # Defining a method with parameters needs parentheses.
73
+ Style/MethodDefParentheses:
74
+ Enabled: true
75
+
76
+ Style/FrozenStringLiteralComment:
77
+ Enabled: true
78
+ EnforcedStyle: always
79
+ Exclude:
80
+ - 'actionview/test/**/*.builder'
81
+ - 'actionview/test/**/*.ruby'
82
+ - 'actionpack/test/**/*.builder'
83
+ - 'actionpack/test/**/*.ruby'
84
+ - 'activestorage/db/migrate/**/*.rb'
85
+
86
+ # Use `foo {}` not `foo{}`.
87
+ Layout/SpaceBeforeBlockBraces:
88
+ Enabled: true
89
+
90
+ # Use `foo { bar }` not `foo {bar}`.
91
+ Layout/SpaceInsideBlockBraces:
92
+ Enabled: true
93
+
94
+ # Use `{ a: 1 }` not `{a:1}`.
95
+ Layout/SpaceInsideHashLiteralBraces:
96
+ Enabled: true
97
+
98
+ Layout/SpaceInsideParens:
99
+ Enabled: true
100
+
101
+ # Check quotes usage according to lint rule below.
102
+ Style/StringLiterals:
103
+ Enabled: true
104
+ EnforcedStyle: double_quotes
105
+
106
+ # Detect hard tabs, no hard tabs.
107
+ Layout/Tab:
108
+ Enabled: true
109
+
110
+ # Blank lines should not have any spaces.
111
+ Layout/TrailingBlankLines:
112
+ Enabled: true
113
+
114
+ # No trailing whitespace.
115
+ Layout/TrailingWhitespace:
116
+ Enabled: true
117
+
118
+ # Use quotes for string literals when they are enough.
119
+ Style/UnneededPercentQ:
120
+ Enabled: true
121
+
122
+ # Align `end` with the matching keyword or starting expression except for
123
+ # assignments, where it should be aligned with the LHS.
124
+ Lint/EndAlignment:
125
+ Enabled: true
126
+ EnforcedStyleAlignWith: variable
127
+
128
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
129
+ Lint/RequireParentheses:
130
+ Enabled: true
@@ -0,0 +1,14 @@
1
+ inherit_from: .rails-rubocop.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'test/**/*'
6
+ - 'lib/active_merchant/**/*'
7
+ - 'bin/**/*'
8
+
9
+ Style/StringLiterals:
10
+ Enabled: true
11
+ EnforcedStyle: single_quotes
12
+
13
+ Style/FrozenStringLiteralComment:
14
+ EnforcedStyle: never
@@ -0,0 +1,21 @@
1
+ Workarea Worldpay Xml 1.0.1 (2019-08-21)
2
+ --------------------------------------------------------------------------------
3
+
4
+ * Open Source!
5
+
6
+
7
+
8
+ Workarea Worldpay Xml 1.0.0 (2018-05-24)
9
+ --------------------------------------------------------------------------------
10
+
11
+ * Worldpay XML payment processor
12
+
13
+ Payment processor for worldpay's xml api. Supports auth, capture
14
+ purchase and refund. Active merchant implemantion was decorated to
15
+ add tokenization.
16
+
17
+ WORLDPAY-1
18
+ Jeff Yucis
19
+
20
+
21
+
@@ -0,0 +1,3 @@
1
+ View this plugin's code of conduct here:
2
+
3
+ <https://github.com/workarea-commerce/workarea/blob/master/CODE_OF_CONDUCT.md>
@@ -0,0 +1,3 @@
1
+ View this plugin's contribution guidelines here:
2
+
3
+ <https://github.com/workarea-commerce/workarea/blob/master/CONTRIBUTING.md>
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "git@github.com:#{repo}.git" }
3
+
4
+ gemspec
5
+
6
+ gem 'workarea'
7
+
8
+ group :test do
9
+ gem 'simplecov', require: false
10
+ end
data/LICENSE ADDED
@@ -0,0 +1,52 @@
1
+ WebLinc
2
+ Business Source License
3
+
4
+ Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
5
+
6
+ Licensed Work: Workarea Commerce Platform
7
+ The Licensed Work is (c) 2019 WebLinc Corporation
8
+
9
+ Additional Use Grant:
10
+ You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
11
+
12
+ A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
13
+
14
+ For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
15
+
16
+ Change Date: 2019-08-20
17
+
18
+ Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
19
+
20
+ Terms
21
+
22
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
23
+
24
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
25
+
26
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
27
+
28
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
29
+
30
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
31
+
32
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
33
+
34
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
35
+
36
+ Covenants of Licensor
37
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
38
+
39
+ To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
40
+
41
+ To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
42
+
43
+ To specify a Change Date.
44
+
45
+ Not to modify this License in any other way.
46
+
47
+ Notice
48
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
49
+
50
+ For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
51
+
52
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
@@ -0,0 +1,63 @@
1
+ Workarea Worldpay Xml
2
+ ================================================================================
3
+
4
+ Worldpay Xml Payment Processor plugin for the Workarea platform.
5
+
6
+ Installation
7
+ --------------------------------------------------------------------------------
8
+
9
+ Add the following block to your gem file:
10
+
11
+ # ...
12
+ gem 'workarea-worldpay-xml', source: 'https://gems.weblinc.com'
13
+ # ...
14
+
15
+ Or use a source block:
16
+
17
+ # ...
18
+ source 'https://gems.weblinc.com' do
19
+ gem 'workarea-worldpay-xml'
20
+ end
21
+ # ...
22
+
23
+ Update your application's bundle.
24
+
25
+ cd path/to/application
26
+ bundle
27
+
28
+
29
+ Add the following to your secrets file:
30
+
31
+ # ...
32
+ worldpay:
33
+ login: MERCHANTCODEHERE
34
+ password: XMLPASSWORD
35
+ test: true
36
+ # ...
37
+
38
+
39
+ *By default tokenzization is not enabled in both live and sandbox account. Be sure to request that tokenzation
40
+ is enabled after installing the plugin.*
41
+
42
+ Documentation and Testing
43
+ --------------------------------------------------------------------------------
44
+
45
+ Worldpay does not issue freestanding sandbox accounts for testing. An account must be provisioned through
46
+ a Worldpay account manager.
47
+
48
+ Documentation for the Worldpay xml gateway can be found at [http://support.worldpay.com/support/kb/gg/corporate-gateway-guide/content/home.htm](http://support.worldpay.com/support/kb/gg/corporate-gateway-guide/content/home.htm)
49
+
50
+ A list of test credit cards and testing values can be found at [http://support.worldpay.com/support/kb/gg/corporate-gateway-guide/content/reference/testvalues.htm](http://support.worldpay.com/support/kb/gg/corporate-gateway-guide/content/reference/testvalues.htm)
51
+
52
+
53
+ Workarea Platform Documentation
54
+ --------------------------------------------------------------------------------
55
+
56
+ See [http://developer.weblinc.com](http://developer.weblinc.com) for Workarea platform documentation.
57
+
58
+ Copyright & Licensing
59
+ --------------------------------------------------------------------------------
60
+
61
+ Copyright WebLinc 2018. All rights reserved.
62
+
63
+ For licensing, contact sales@workarea.com.
@@ -0,0 +1,60 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+ RDoc::Task.new(:rdoc) do |rdoc|
9
+ rdoc.rdoc_dir = 'rdoc'
10
+ rdoc.title = 'Worldpay Xml'
11
+ rdoc.options << '--line-numbers'
12
+ rdoc.rdoc_files.include('README.md')
13
+ rdoc.rdoc_files.include('lib/**/*.rb')
14
+ end
15
+
16
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
17
+ load 'rails/tasks/engine.rake'
18
+ load 'rails/tasks/statistics.rake'
19
+ load 'workarea/changelog.rake'
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |t|
23
+ t.libs << 'lib'
24
+ t.libs << 'test'
25
+ t.pattern = 'test/**/*_test.rb'
26
+ t.verbose = false
27
+ end
28
+ task default: :test
29
+
30
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
31
+ require 'workarea/worldpay_xml/version'
32
+
33
+ desc "Release version #{Workarea::WorldpayXml::VERSION} of the gem"
34
+ task :release do
35
+ host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
36
+
37
+ #Rake::Task['workarea:changelog'].execute
38
+ #system 'git add CHANGELOG.md'
39
+ #system 'git commit -m "Update CHANGELOG"'
40
+ #system 'git push origin HEAD'
41
+
42
+ system "git tag -a v#{Workarea::WorldpayXml::VERSION} -m 'Tagging #{Workarea::WorldpayXml::VERSION}'"
43
+ system 'git push --tags'
44
+
45
+ system 'gem build workarea-worldpay_xml.gemspec'
46
+ system "gem push workarea-worldpay_xml-#{Workarea::WorldpayXml::VERSION}.gem"
47
+ system "gem push workarea-worldpay_xml-#{Workarea::WorldpayXml::VERSION}.gem --host #{host}"
48
+ system "rm workarea-worldpay_xml-#{Workarea::WorldpayXml::VERSION}.gem"
49
+ end
50
+
51
+ desc 'Run the JavaScript tests'
52
+ ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
53
+ task teaspoon: 'app:teaspoon'
54
+
55
+ desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
56
+ task :teaspoon_server do
57
+ Dir.chdir('test/dummy')
58
+ teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
59
+ system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
60
+ end