ballast 1.9.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +35 -0
  3. data/.travis-gemfile +4 -5
  4. data/.travis.yml +3 -2
  5. data/CHANGELOG.md +62 -6
  6. data/Gemfile +7 -8
  7. data/README.md +2 -2
  8. data/ballast.gemspec +9 -12
  9. data/doc/Ballast/AjaxResponse.html +1380 -0
  10. data/doc/Ballast/Concerns/AjaxHandling.html +662 -0
  11. data/doc/Ballast/Concerns/Common.html +81 -361
  12. data/doc/Ballast/Concerns/ErrorsHandling.html +18 -36
  13. data/doc/Ballast/Concerns/View.html +181 -157
  14. data/doc/Ballast/Concerns.html +6 -6
  15. data/doc/Ballast/Configuration.html +204 -31
  16. data/doc/Ballast/Emoji/Character.html +411 -0
  17. data/doc/Ballast/Emoji/Utils.html +794 -0
  18. data/doc/Ballast/Emoji.html +125 -0
  19. data/doc/Ballast/Errors/{BaseError.html → Base.html} +61 -34
  20. data/doc/Ballast/Errors/{PerformError.html → Failure.html} +21 -17
  21. data/doc/Ballast/Errors/InvalidDomain.html +11 -11
  22. data/doc/Ballast/Errors/{ValidationError.html → ValidationFailure.html} +24 -16
  23. data/doc/Ballast/Errors.html +5 -5
  24. data/doc/Ballast/Middlewares/DefaultHost.html +6 -6
  25. data/doc/Ballast/Middlewares.html +4 -4
  26. data/doc/Ballast/RequestDomainMatcher.html +28 -28
  27. data/doc/Ballast/Service/Response.html +1243 -0
  28. data/doc/Ballast/Service.html +1314 -0
  29. data/doc/Ballast/Version.html +7 -7
  30. data/doc/Ballast.html +15 -15
  31. data/doc/_index.html +59 -30
  32. data/doc/class_list.html +6 -2
  33. data/doc/css/style.css +1 -0
  34. data/doc/file.README.html +6 -6
  35. data/doc/file_list.html +5 -1
  36. data/doc/frames.html +1 -1
  37. data/doc/index.html +6 -6
  38. data/doc/js/full_list.js +4 -1
  39. data/doc/method_list.html +167 -79
  40. data/doc/top-level-namespace.html +41 -4
  41. data/lib/ballast/ajax_response.rb +76 -0
  42. data/lib/ballast/concerns/ajax_handling.rb +73 -0
  43. data/lib/ballast/concerns/common.rb +25 -47
  44. data/lib/ballast/concerns/errors_handling.rb +21 -30
  45. data/lib/ballast/concerns/view.rb +24 -22
  46. data/lib/ballast/configuration.rb +30 -10
  47. data/lib/ballast/emoji.rb +114 -0
  48. data/lib/ballast/errors.rb +16 -13
  49. data/lib/ballast/middlewares/default_host.rb +3 -3
  50. data/lib/ballast/request_domain_matcher.rb +7 -7
  51. data/lib/ballast/service.rb +147 -0
  52. data/lib/ballast/version.rb +3 -3
  53. data/lib/ballast.rb +22 -22
  54. data/spec/ballast/ajax_response_spec.rb +61 -0
  55. data/spec/ballast/concerns/ajax_handling_spec.rb +86 -0
  56. data/spec/ballast/concerns/common_spec.rb +17 -52
  57. data/spec/ballast/concerns/errors_handling_spec.rb +35 -29
  58. data/spec/ballast/concerns/view_spec.rb +21 -32
  59. data/spec/ballast/configuration_spec.rb +66 -16
  60. data/spec/ballast/emoji_spec.rb +103 -0
  61. data/spec/ballast/errors_spec.rb +5 -5
  62. data/spec/ballast/middlewares/default_host_spec.rb +3 -5
  63. data/spec/ballast/request_domain_matcher_spec.rb +4 -4
  64. data/spec/ballast/service_spec.rb +137 -0
  65. data/spec/spec_helper.rb +1 -13
  66. metadata +42 -80
  67. data/doc/Ballast/Concerns/Ajax.html +0 -945
  68. data/doc/Ballast/Context.html +0 -417
  69. data/doc/Ballast/Operation.html +0 -1304
  70. data/doc/Ballast/OperationsChain.html +0 -597
  71. data/lib/ballast/concerns/ajax.rb +0 -134
  72. data/lib/ballast/context.rb +0 -38
  73. data/lib/ballast/operation.rb +0 -136
  74. data/lib/ballast/operations_chain.rb +0 -45
  75. data/spec/ballast/concerns/ajax_spec.rb +0 -141
  76. data/spec/ballast/context_spec.rb +0 -23
  77. data/spec/ballast/operation_spec.rb +0 -177
  78. data/spec/ballast/operations_chain_spec.rb +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 024d28958af05267b4499eb6d73260cba811f54e
4
- data.tar.gz: c88ba674fba0b08e527824e73a080c6bbc1f8b78
3
+ metadata.gz: b6a11a3d45818371403c9782356182899540a6d6
4
+ data.tar.gz: f0a8c48c776d72f28a20fef0e91d197d1b5ccb30
5
5
  SHA512:
6
- metadata.gz: cffc97cd9e220c174e38952228ed3b2324c48022597cf47711e2a72200755c297b617e2880b7b7efa6157f030bb05d6b4ecd006bd86e9c4e79ee86ad799a0ded
7
- data.tar.gz: 5c56e7aecaac44c11a99118a8751c0e14dff2808a7e07820b6f620a6f4899ed4d185d9f8836eae1144968a0d0a5c05b5906d32536b9e0a2997d8ecae533ecfff
6
+ metadata.gz: 107f436f2a8936528f94a376a7d2102edcfb6a5eee3df3ef6e2022a928dff5b64e82e1b1b3381fb0c55daf09dff249aa226cf8eac55934cecf2209582df040c7
7
+ data.tar.gz: f7dba9b94cf951e0e71a5a17d67ea9fb9d04dc030f4248d416e408240d32658ae6c035bfc1b9c5df94cc28568b5f84644090e2974415bcbc36d0cee63e2e471d
data/.rubocop.yml ADDED
@@ -0,0 +1,35 @@
1
+ AsciiComments:
2
+ Enabled: false
3
+
4
+ Blocks:
5
+ Enabled: false
6
+
7
+ BracesAroundHashParameters:
8
+ Enabled: false
9
+
10
+ CyclomaticComplexity:
11
+ Max: 15
12
+
13
+ EachWithObject:
14
+ Enabled: false
15
+
16
+ IndentationConsistency:
17
+ Enabled: false
18
+
19
+ IndentHash:
20
+ Enabled: false
21
+
22
+ LineLength:
23
+ Max: 160
24
+
25
+ ParameterLists:
26
+ Max: 6
27
+
28
+ SignalException:
29
+ Enabled: false
30
+
31
+ SpaceInsideHashLiteralBraces:
32
+ Enabled: false
33
+
34
+ StringLiterals:
35
+ Enabled: false
data/.travis-gemfile CHANGED
@@ -8,8 +8,7 @@ source "http://rubygems.org"
8
8
  gemspec
9
9
 
10
10
  # Testing gems
11
- gem "rspec", "~> 2.14.1"
12
- gem "rake", "~> 10.1.1"
13
- gem "spork", "~> 1.0rc"
14
- gem "simplecov", ">= 0.8.2"
15
- gem "coveralls", ">= 0.7.0", require: false
11
+ gem "rspec", "~> 3.1"
12
+ gem "rake", "~> 10.3"
13
+ gem "simplecov", ">= 0.9"
14
+ gem "coveralls", ">= 0.7", require: false
data/.travis.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.0
3
+ - 2.1.2
4
+ #- jruby-head
5
+ #- rbx-2.2.7
5
6
  script: bundle exec rake spec:coverage
6
7
  gemfile: .travis-gemfile
7
8
  notifications:
data/CHANGELOG.md CHANGED
@@ -1,10 +1,66 @@
1
+ ### 2.0.0 / 2014-11-02
2
+
3
+ #### General
4
+
5
+ * **Dropped compatibility for Ruby < 2.1**.
6
+ * Added `Ballast::AjaxResponse`.
7
+ * Added `Ballast::Emoji`.
8
+ * Added `Ballast::Service`.
9
+ * Added `Ballast::ServiceResponse`.
10
+ * Removed `Ballast::Context`.
11
+ * Removed `Ballast::Operation`.
12
+ * Removed `Ballast::OperationsChain`.
13
+
14
+ #### Ballast::Errors
15
+
16
+ * Renamed `Ballast::Errors::BaseError` to `Ballast::Errors::Base`.
17
+ * Renamed `Ballast::Errors::PerformError` to `Ballast::Errors::Failure`.
18
+ * Renamed `Ballast::Errors::ValidationError` to `Ballast::Errors::ValidationFailure`.
19
+ * Renamed attribute `response` to `details` in `Ballast::Errors::Base`.
20
+
21
+ #### Ballast::Configuration
22
+
23
+ * Added `Ballast::Configuration#default_root`.
24
+ * Added `Ballast::Configuration#default_environment`.
25
+ * Changed interface of `Ballast::Configuration#initialize`.
26
+
27
+ #### Ballast::Concerns::AjaxHandling (formerly Ballast::Concerns::Ajax)
28
+
29
+ * Renamed `Ballast::Concerns::Ajax` to `Ballast::Concerns::AjaxHandling`
30
+ * Renamed `Ballast::Concerns::AjaxHandling#is_ajax_request?` to `Ballast::Concerns::AjaxHandling#ajax_request?`.
31
+ * Renamed `Ballast::Concerns::AjaxHandling#prepare_ajax` to `Ballast::Concerns::AjaxHandling#prepare_ajax_response` and changed its interface.
32
+ * Move responsibility of `Ballast::Concerns::AjaxHandling#send_ajax` to `Ballast::AjaxResponse#send`.
33
+ * Move responsibility of `Ballast::Concerns::AjaxHandling#update_ajax` to `Ballast::AjaxResponse#import_from_service`.
34
+ * Changed interface of `Ballast::Concerns::AjaxHandling#generate_robots_txt`.
35
+
36
+ #### Ballast::Concerns::Common
37
+
38
+ * Renamed `Ballast::Concerns::Common#is_json?` to `Ballast::Concerns::Common#json?`.
39
+ * Renamed `Ballast::Concerns::Common#sending_data?` to `Ballast::Concerns::Common#request_data?`.
40
+ * Changed interface of `Ballast::Concerns::Common#format_short_duration`.
41
+ * Changed interface of `Ballast::Concerns::Common#format_short_amount`.
42
+ * Changed interface of `Ballast::Concerns::Common#format_long_date`.
43
+ * Changed interface of `Ballast::Concerns::Common#authenticate_user`.
44
+
45
+ #### Ballast::Concerns::ErrorsHandling
46
+
47
+ * Changed interface of `Ballast::Concerns::ErrorsHandling#handle_error`.
48
+ * `Ballast::Concerns::ErrorsHandling::handle_error` now sets only one variable, `@error`, which contains the previous version variables and embeds the exception.
49
+
50
+ #### Ballast::Concerns::View
51
+
52
+ * Renamed `Ballast::Concerns::View#set_layout_params` to `Ballast::Concerns::View#update_layout_params`.
53
+ * Renamed `Ballast::Concerns::View#add_javascript_params` to `Ballast::Concerns::View#update_javascript_params` and changed its interface.
54
+ * Changed interface of `Ballast::Concerns::View#browser_supported?`.
55
+ * Changed interface of `Ballast::Concerns::View#javascript_params`.
56
+
1
57
  ### 1.9.3 / 2014-03-15
2
58
 
3
- * Added `Ballast::Concerns::Ajax::generate_robots_txt`.
59
+ * Added `Ballast::Concerns::Ajax#generate_robots_txt`.
4
60
 
5
61
  ### 1.9.2 / 2014-03-09
6
62
 
7
- * Fixed type for HTML in `Ballast::Concerns::ErrorsHandling::handle_error`.
63
+ * Fixed type for HTML in `Ballast::Concerns::ErrorsHandling#handle_error`.
8
64
 
9
65
  ### 1.9.1 / 2014-03-08
10
66
 
@@ -20,14 +76,14 @@
20
76
 
21
77
  ### 1.7.0 / 2014-01-25
22
78
 
23
- * Added `Ballast::Concerns::View::set_layout_params`.
24
- * Added `Ballast::Concerns::View::layout_params`.
25
- * Added `Ballast::Concerns::View::layout_param`.
79
+ * Added `Ballast::Concerns::View#set_layout_params`.
80
+ * Added `Ballast::Concerns::View#layout_params`.
81
+ * Added `Ballast::Concerns::View#layout_param`.
26
82
 
27
83
  ### 1.6.0 / 2014-01-25
28
84
 
29
85
  * `Ballast::Concerns::Ajax#allow_cors`'s parameters are now customizable.
30
- * Added `Ballast::Concerns::Common::perform_operations_chain`.
86
+ * Added `Ballast::Concerns::Common#perform_operations_chain`.
31
87
  * Fixed `Ballast::OperationsChain` behavior.
32
88
 
33
89
  ### 1.5.3 / 2014-01-04
data/Gemfile CHANGED
@@ -8,14 +8,13 @@ source "http://rubygems.org"
8
8
  gemspec
9
9
 
10
10
  # Testing
11
- gem "rspec", "~> 2.14.1"
12
- gem "rake", "~> 10.1.1"
13
- gem "spork", "~> 1.0rc"
11
+ gem "rspec", "~> 3.1"
12
+ gem "rake", "~> 10.3"
14
13
 
15
14
  # Documentation
16
- gem "simplecov", ">= 0.8.2"
17
- gem "coveralls", ">= 0.7.0", require: false
15
+ gem "simplecov", ">= 0.9"
16
+ gem "coveralls", ">= 0.7", require: false
18
17
  gem "pry", ">= 0"
19
- gem "yard", ">= 0.8.7.3"
20
- gem "kramdown", ">= 1.3.2"
21
- gem "github-markup", ">= 1.0.2"
18
+ gem "yard", ">= 0.8"
19
+ gem "kramdown", ">= 1.5"
20
+ gem "github-markup", ">= 1.3"
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  A collection of base utilities for Ruby on Rails.
11
11
 
12
- http://sw.cow.tc/ballast
12
+ http://sw.cowtech.it/ballast
13
13
 
14
14
  http://rdoc.info/gems/ballast
15
15
 
@@ -17,7 +17,7 @@ http://rdoc.info/gems/ballast
17
17
 
18
18
  Ballast is a gem which tries to solve common issues which we all (or, at least, me) usually encounter when we develop with Ruby On Rails.
19
19
 
20
- The first big issue is having fat controllers. To solve this, ballast enbraces the idea of the [interactor](https://github.com/collectiveidea/interactor) gem and it extends it using operations and operations chains.
20
+ The first big issue is having fat controllers. To solve this, ballast enbraces the idea of the [interactor](https://github.com/collectiveidea/interactor) gem and it implements a service interface.
21
21
 
22
22
  The second issue is handling AJAX actions in a short way. To solve this, ballast provides the Ajax concern to ease the handling of JSON data, both inbound and outbound.
23
23
 
data/ballast.gemspec CHANGED
@@ -8,9 +8,9 @@ require File.expand_path("../lib/ballast/version", __FILE__)
8
8
  Gem::Specification.new do |gem|
9
9
  gem.name = "ballast"
10
10
  gem.version = Ballast::Version::STRING
11
- gem.homepage = "http://github.com/ShogunPanda/ballast"
12
- gem.summary = "A collection of base utilities for Ruby on Rails."
13
- gem.description = "A collection of base utilities for Ruby on Rails."
11
+ gem.homepage = "http://sw.cowtech.it/ballast"
12
+ gem.summary = "A collection of base utilities for web frameworks."
13
+ gem.description = "A collection of base utilities for web frameworks."
14
14
  gem.rubyforge_project = "ballast"
15
15
 
16
16
  gem.authors = ["Shogun"]
@@ -22,14 +22,11 @@ Gem::Specification.new do |gem|
22
22
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
23
  gem.require_paths = ["lib"]
24
24
 
25
- gem.required_ruby_version = ">= 2.0"
25
+ gem.required_ruby_version = ">= 2.1.0"
26
26
 
27
- gem.add_dependency("actionpack", ">= 4.0.3")
28
- gem.add_dependency("rack", "~> 1.5.2")
29
- gem.add_dependency("oj", "~> 2.5.4")
30
- gem.add_dependency("brauser", "~> 3.2.6")
31
- gem.add_dependency("interactor", "~> 2.1.0")
32
- gem.add_dependency("addressable", "~> 2.3.5")
33
- gem.add_dependency("rack-fiber_pool", ">= 0.9.3")
27
+ gem.add_dependency("actionpack", "~> 4.1")
28
+ gem.add_dependency("brauser", "~> 4.0")
29
+ gem.add_dependency("addressable", "~> 2.3")
34
30
  gem.add_dependency("em-synchrony", "~> 1.0.3")
35
- end
31
+ gem.add_dependency("gemoji", "~> 2.1")
32
+ end