ballast 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis-gemfile +15 -0
  4. data/.travis.yml +7 -0
  5. data/.yardopts +1 -0
  6. data/CHANGELOG.md +4 -0
  7. data/Gemfile +21 -0
  8. data/README.md +40 -0
  9. data/Rakefile +28 -0
  10. data/ballast.gemspec +35 -0
  11. data/doc/Ballast/Concerns/Ajax.html +806 -0
  12. data/doc/Ballast/Concerns/Common.html +900 -0
  13. data/doc/Ballast/Concerns/ErrorsHandling.html +283 -0
  14. data/doc/Ballast/Concerns/View.html +664 -0
  15. data/doc/Ballast/Concerns.html +127 -0
  16. data/doc/Ballast/Context.html +417 -0
  17. data/doc/Ballast/Errors/BaseError.html +326 -0
  18. data/doc/Ballast/Errors/InvalidDomain.html +157 -0
  19. data/doc/Ballast/Errors/PerformError.html +157 -0
  20. data/doc/Ballast/Errors/ValidationError.html +157 -0
  21. data/doc/Ballast/Errors.html +125 -0
  22. data/doc/Ballast/Operation.html +1304 -0
  23. data/doc/Ballast/OperationsChain.html +585 -0
  24. data/doc/Ballast/Version.html +189 -0
  25. data/doc/Ballast.html +130 -0
  26. data/doc/_index.html +267 -0
  27. data/doc/class_list.html +54 -0
  28. data/doc/css/common.css +1 -0
  29. data/doc/css/full_list.css +57 -0
  30. data/doc/css/style.css +338 -0
  31. data/doc/file.README.html +115 -0
  32. data/doc/file_list.html +56 -0
  33. data/doc/frames.html +26 -0
  34. data/doc/index.html +115 -0
  35. data/doc/js/app.js +219 -0
  36. data/doc/js/full_list.js +178 -0
  37. data/doc/js/jquery.js +4 -0
  38. data/doc/method_list.html +269 -0
  39. data/doc/top-level-namespace.html +112 -0
  40. data/lib/ballast/concerns/ajax.rb +116 -0
  41. data/lib/ballast/concerns/common.rb +97 -0
  42. data/lib/ballast/concerns/errors_handling.rb +49 -0
  43. data/lib/ballast/concerns/view.rb +63 -0
  44. data/lib/ballast/context.rb +38 -0
  45. data/lib/ballast/errors.rb +34 -0
  46. data/lib/ballast/operation.rb +136 -0
  47. data/lib/ballast/operations_chain.rb +38 -0
  48. data/lib/ballast/version.rb +24 -0
  49. data/lib/ballast.rb +24 -0
  50. data/spec/ballast/concerns/ajax_spec.rb +124 -0
  51. data/spec/ballast/concerns/common_spec.rb +100 -0
  52. data/spec/ballast/concerns/errors_handling_spec.rb +63 -0
  53. data/spec/ballast/concerns/view_spec.rb +107 -0
  54. data/spec/ballast/context_spec.rb +23 -0
  55. data/spec/ballast/errors_spec.rb +16 -0
  56. data/spec/ballast/operation_spec.rb +175 -0
  57. data/spec/ballast/operations_chain_spec.rb +33 -0
  58. data/spec/coverage_helper.rb +19 -0
  59. data/spec/spec_helper.rb +19 -0
  60. metadata +225 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6b79215fe5cc5404248bada4a5d67b320582934f
4
+ data.tar.gz: ad9804277930f00baa19b5ccece339e487859492
5
+ SHA512:
6
+ metadata.gz: 6bbabf3bd4b0e6f577edc97543b4c0fa62867858589b85eb81b76f7ce4da11294625cad8d803afc335bc2753b47a435de395862d293431cea596cae2c7961de6
7
+ data.tar.gz: a1a82143fd2206a14a5c88cf812e86d7fa00ec05ea9a77f6bf677bcb0b6cafc8eaf35bb14515653ebe54142d8e6c6608c3ed6de6dc1cde4ef95ea5e9492d97a1
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ Gemfile.lock
2
+ tester.rb
3
+ coverage/
4
+ pkg/
5
+ .idea/
6
+ .yardoc/
7
+ /metrics
8
+ /.metrics
9
+ /tmp/metric_fu
data/.travis-gemfile ADDED
@@ -0,0 +1,15 @@
1
+ #
2
+ # This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ source "http://rubygems.org"
7
+
8
+ gemspec
9
+
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
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ script: bundle exec rake spec:coverage
5
+ gemfile: .travis-gemfile
6
+ notifications:
7
+ email: false
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ -m markdown
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ### 1.0.0 / 2013-12-25
2
+
3
+ * Initial version.
4
+
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ #
2
+ # This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ source "http://rubygems.org"
7
+
8
+ gemspec
9
+
10
+ # Testing
11
+ gem "rspec", "~> 2.14.1"
12
+ gem "rake", "~> 10.1.1"
13
+ gem "spork", "~> 1.0rc"
14
+
15
+ # Documentation
16
+ gem "simplecov", ">= 0.8.2"
17
+ gem "coveralls", ">= 0.7.0", require: false
18
+ gem "pry", ">= 0"
19
+ gem "yard", ">= 0.8.7.3"
20
+ gem "kramdown", ">= 1.3.0"
21
+ gem "github-markup", ">= 1.0.0"
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # ballast
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/ballast.png)](http://badge.fury.io/rb/ballast)
4
+ [![Dependency Status](https://gemnasium.com/ShogunPanda/ballast.png?travis)](https://gemnasium.com/ShogunPanda/ballast)
5
+ [![Build Status](https://secure.travis-ci.org/ShogunPanda/ballast.png?branch=master)](https://travis-ci.org/ShogunPanda/ballast)
6
+ [![Code Climate](https://codeclimate.com/github/ShogunPanda/ballast.png)](https://codeclimate.com/github/ShogunPanda/ballast)
7
+ [![Coverage Status](https://coveralls.io/repos/ShogunPanda/ballast/badge.png)](https://coveralls.io/r/ShogunPanda/ballast)
8
+ [![Bitdeli Trend](https://d2weczhvl823v0.cloudfront.net/ShogunPanda/ballast/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
9
+
10
+ A collection of base utilities for Ruby on Rails.
11
+
12
+ http://sw.cow.tc/ballast
13
+
14
+ http://rdoc.info/gems/ballast
15
+
16
+ # Description
17
+
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
+
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.
21
+
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
+
24
+ Finally, minor concerns are provided to scope CSS and handling errors.
25
+
26
+ ## Contributing to ballast
27
+
28
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
29
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
30
+ * Fork the project.
31
+ * Start a feature/bugfix branch.
32
+ * Commit and push until you are happy with your contribution.
33
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
34
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
35
+
36
+ ## Copyright
37
+
38
+ Copyright (C) 2013 and above Shogun (shogun@cowtech.it).
39
+
40
+ Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ #
2
+ # This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ require "bundler/gem_tasks"
7
+ require "rspec/core/rake_task"
8
+
9
+ RSpec::Core::RakeTask.new("spec")
10
+ RSpec::Core::RakeTask.new("spec:coverage") { |t| t.ruby_opts = "-r./spec/coverage_helper" }
11
+
12
+ desc "Generate the documentation"
13
+ task :docs do
14
+ system("yardoc") || raise("Failed Execution of: yardoc")
15
+ end
16
+
17
+ desc "Get the current release version"
18
+ task :version, :with_name do |_, args|
19
+ gem = Bundler::GemHelper.instance.gemspec
20
+ puts [args[:with_name] == "true" ? gem.name : nil, gem.version].compact.join("-")
21
+ end
22
+
23
+ desc "Prepare the release"
24
+ task prerelease: ["spec:coverage", "docs"] do
25
+ ["git add -A", "git commit -am \"Version #{Bundler::GemHelper.instance.gemspec.version}\""].each do |cmd|
26
+ system(cmd) || raise("Failed Execution of: #{cmd}")
27
+ end
28
+ end
data/ballast.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ #
2
+ # This file is part of the ballast gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
3
+ # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
4
+ #
5
+
6
+ require File.expand_path("../lib/ballast/version", __FILE__)
7
+
8
+ Gem::Specification.new do |gem|
9
+ gem.name = "ballast"
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."
14
+ gem.rubyforge_project = "ballast"
15
+
16
+ gem.authors = ["Shogun"]
17
+ gem.email = ["shogun@cowtech.it"]
18
+ gem.license = "MIT"
19
+
20
+ gem.files = `git ls-files`.split($\)
21
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
22
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
23
+ gem.require_paths = ["lib"]
24
+
25
+ gem.required_ruby_version = ">= 2.0"
26
+
27
+ gem.add_dependency("actionpack", "~> 4.0.0")
28
+ gem.add_dependency("rack", "~> 1.5.2")
29
+ gem.add_dependency("lazier", "~> 3.3.10")
30
+ gem.add_dependency("brauser", "~> 3.2.4")
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")
34
+ gem.add_dependency("em-synchrony", "~> 1.0.3")
35
+ end