ballast 1.9.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +35 -0
- data/.travis-gemfile +4 -5
- data/.travis.yml +3 -2
- data/CHANGELOG.md +62 -6
- data/Gemfile +7 -8
- data/README.md +2 -2
- data/ballast.gemspec +9 -12
- data/doc/Ballast/AjaxResponse.html +1380 -0
- data/doc/Ballast/Concerns/AjaxHandling.html +662 -0
- data/doc/Ballast/Concerns/Common.html +81 -361
- data/doc/Ballast/Concerns/ErrorsHandling.html +18 -36
- data/doc/Ballast/Concerns/View.html +181 -157
- data/doc/Ballast/Concerns.html +6 -6
- data/doc/Ballast/Configuration.html +204 -31
- data/doc/Ballast/Emoji/Character.html +411 -0
- data/doc/Ballast/Emoji/Utils.html +794 -0
- data/doc/Ballast/Emoji.html +125 -0
- data/doc/Ballast/Errors/{BaseError.html → Base.html} +61 -34
- data/doc/Ballast/Errors/{PerformError.html → Failure.html} +21 -17
- data/doc/Ballast/Errors/InvalidDomain.html +11 -11
- data/doc/Ballast/Errors/{ValidationError.html → ValidationFailure.html} +24 -16
- data/doc/Ballast/Errors.html +5 -5
- data/doc/Ballast/Middlewares/DefaultHost.html +6 -6
- data/doc/Ballast/Middlewares.html +4 -4
- data/doc/Ballast/RequestDomainMatcher.html +28 -28
- data/doc/Ballast/Service/Response.html +1243 -0
- data/doc/Ballast/Service.html +1314 -0
- data/doc/Ballast/Version.html +7 -7
- data/doc/Ballast.html +15 -15
- data/doc/_index.html +59 -30
- data/doc/class_list.html +6 -2
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +6 -6
- data/doc/file_list.html +5 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +6 -6
- data/doc/js/full_list.js +4 -1
- data/doc/method_list.html +167 -79
- data/doc/top-level-namespace.html +41 -4
- data/lib/ballast/ajax_response.rb +76 -0
- data/lib/ballast/concerns/ajax_handling.rb +73 -0
- data/lib/ballast/concerns/common.rb +25 -47
- data/lib/ballast/concerns/errors_handling.rb +21 -30
- data/lib/ballast/concerns/view.rb +24 -22
- data/lib/ballast/configuration.rb +30 -10
- data/lib/ballast/emoji.rb +114 -0
- data/lib/ballast/errors.rb +16 -13
- data/lib/ballast/middlewares/default_host.rb +3 -3
- data/lib/ballast/request_domain_matcher.rb +7 -7
- data/lib/ballast/service.rb +147 -0
- data/lib/ballast/version.rb +3 -3
- data/lib/ballast.rb +22 -22
- data/spec/ballast/ajax_response_spec.rb +61 -0
- data/spec/ballast/concerns/ajax_handling_spec.rb +86 -0
- data/spec/ballast/concerns/common_spec.rb +17 -52
- data/spec/ballast/concerns/errors_handling_spec.rb +35 -29
- data/spec/ballast/concerns/view_spec.rb +21 -32
- data/spec/ballast/configuration_spec.rb +66 -16
- data/spec/ballast/emoji_spec.rb +103 -0
- data/spec/ballast/errors_spec.rb +5 -5
- data/spec/ballast/middlewares/default_host_spec.rb +3 -5
- data/spec/ballast/request_domain_matcher_spec.rb +4 -4
- data/spec/ballast/service_spec.rb +137 -0
- data/spec/spec_helper.rb +1 -13
- metadata +42 -80
- data/doc/Ballast/Concerns/Ajax.html +0 -945
- data/doc/Ballast/Context.html +0 -417
- data/doc/Ballast/Operation.html +0 -1304
- data/doc/Ballast/OperationsChain.html +0 -597
- data/lib/ballast/concerns/ajax.rb +0 -134
- data/lib/ballast/context.rb +0 -38
- data/lib/ballast/operation.rb +0 -136
- data/lib/ballast/operations_chain.rb +0 -45
- data/spec/ballast/concerns/ajax_spec.rb +0 -141
- data/spec/ballast/context_spec.rb +0 -23
- data/spec/ballast/operation_spec.rb +0 -177
- data/spec/ballast/operations_chain_spec.rb +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6a11a3d45818371403c9782356182899540a6d6
|
4
|
+
data.tar.gz: f0a8c48c776d72f28a20fef0e91d197d1b5ccb30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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", "~>
|
12
|
-
gem "rake", "~> 10.
|
13
|
-
gem "
|
14
|
-
gem "
|
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
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
|
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
|
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
|
24
|
-
* Added `Ballast::Concerns::View
|
25
|
-
* Added `Ballast::Concerns::View
|
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
|
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", "~>
|
12
|
-
gem "rake", "~> 10.
|
13
|
-
gem "spork", "~> 1.0rc"
|
11
|
+
gem "rspec", "~> 3.1"
|
12
|
+
gem "rake", "~> 10.3"
|
14
13
|
|
15
14
|
# Documentation
|
16
|
-
gem "simplecov", ">= 0.
|
17
|
-
gem "coveralls", ">= 0.7
|
15
|
+
gem "simplecov", ">= 0.9"
|
16
|
+
gem "coveralls", ">= 0.7", require: false
|
18
17
|
gem "pry", ">= 0"
|
19
|
-
gem "yard", ">= 0.8
|
20
|
-
gem "kramdown", ">= 1.
|
21
|
-
gem "github-markup", ">= 1.
|
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.
|
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
|
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://
|
12
|
-
gem.summary = "A collection of base utilities for
|
13
|
-
gem.description = "A collection of base utilities for
|
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", "
|
28
|
-
gem.add_dependency("
|
29
|
-
gem.add_dependency("
|
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
|
-
|
31
|
+
gem.add_dependency("gemoji", "~> 2.1")
|
32
|
+
end
|