mini_style 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22ce17bd3e4faf420d9715cd5735e7f10532d481
4
- data.tar.gz: cfbb0ba991d25fba9bf62683af87fa0836d6c64f
3
+ metadata.gz: 6f56f9447e259cd7877657fb16222e0efae9f2a3
4
+ data.tar.gz: 138bd0127c101c2ea080aba8cd4385239dc27149
5
5
  SHA512:
6
- metadata.gz: 8c06c8fd73bba1e851d9eed3b8be9de3038567ee7abe1a2a1b083092644ec3c44dc419e940d9ce3276994d7005cb1934fbd909ca1f7094c2a0c589e7bb5f751f
7
- data.tar.gz: 0791cb16ad6331080bc5af37f1413dd2407ae73bf33a3b0ae2e67a346fc8d44fbf6bdf2fd0db2d766f3df9ce6fa2a040fe06310f2db2057838fdc5b904df3dd7
6
+ metadata.gz: 01ccf66bbc119e51a2c3f362e09b34a5563127d489333d45ada431420759145d10b1cb94790ab82b3fa97461ea7c98a6df560f87fd86cd72b17b0b4307b713da
7
+ data.tar.gz: c4de77f3a40cf88517e2f39f44b669ec952f6013e0f3c9b3159042c5a19234dca8fa8064804557d96b7898a4c13a7f42f6699b78b32754733e547fe8448cd24f
@@ -0,0 +1,10 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2015-05-29 01:06:45 +0900 using RuboCop version 0.30.0.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 3
9
+ Style/Documentation:
10
+ Enabled: false
@@ -1,3 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.0
3
+ - 2.2.2
4
+ notifications:
5
+ email: false
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in mini_style.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'rubocop', require: false
8
+ gem 'coveralls', require: false
9
+ end
data/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![Gem Version](https://badge.fury.io/rb/mini_style.svg)](http://badge.fury.io/rb/mini_style)
2
+ [![Build Status](https://travis-ci.org/sinsoku/mini_style.svg?branch=master)](https://travis-ci.org/sinsoku/mini_style)
3
+ [![Code Climate](https://img.shields.io/codeclimate/github/sinsoku/mini_style.svg)](https://codeclimate.com/github/sinsoku/mini_style)
4
+ [![Coverage Status](https://coveralls.io/repos/sinsoku/mini_style/badge.svg?branch=master)](https://coveralls.io/r/sinsoku/mini_style?branch=master)
5
+
1
6
  # MiniStyle
2
7
 
3
8
  `mini_style` provides a simple helper.
data/Rakefile CHANGED
@@ -1,7 +1,9 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ require 'rubocop/rake_task'
7
+ RuboCop::RakeTask.new
7
8
 
9
+ task default: [:rubocop, :spec]
@@ -1,14 +1,16 @@
1
- require "mini_style/version"
1
+ require 'mini_style/version'
2
2
 
3
3
  module MiniStyle
4
4
  module Helpers
5
- def style(default=nil, options={})
5
+ def style(default = nil, options = {})
6
6
  if default.is_a?(Hash)
7
7
  options = default
8
8
  elsif default
9
9
  options[default] = true
10
10
  end
11
- options.select { |k,v| v }.keys.join(' ')
11
+
12
+ styles = options.select { |_k, v| v }.keys
13
+ styles.size > 0 ? styles.join(' ') : nil
12
14
  end
13
15
  end
14
16
  end
@@ -1,6 +1,6 @@
1
1
  module MiniStyle
2
2
  class Railtie < ::Rails::Railtie
3
- initializer 'mini_style' do |app|
3
+ initializer 'mini_style' do |_app|
4
4
  ActionView::Base.send :include, MiniStyle::Helpers
5
5
  end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module MiniStyle
2
- VERSION = "0.0.1"
2
+ VERSION = '1.0.0'
3
3
  end
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'mini_style/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "mini_style"
7
+ spec.name = 'mini_style'
8
8
  spec.version = MiniStyle::VERSION
9
- spec.authors = ["sinsoku"]
10
- spec.email = ["sinsoku.listy@gmail.com"]
11
- spec.summary = %q{mini_style provides a simple helper}
12
- spec.description = %q{mini_style provides a simple helper}
13
- spec.homepage = ""
14
- spec.license = "MIT"
9
+ spec.authors = ['sinsoku']
10
+ spec.email = ['sinsoku.listy@gmail.com']
11
+ spec.summary = 'mini_style provides a simple helper'
12
+ spec.description = 'mini_style provides a simple helper'
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "rspec"
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rspec'
24
24
  end
@@ -18,4 +18,9 @@ describe MiniStyle do
18
18
  subject { helper.style('alert', 'alert-danger': true, disabled: false) }
19
19
  it { is_expected.to eq 'alert-danger alert' }
20
20
  end
21
+
22
+ context 'no conditions match' do
23
+ subject { helper.style(disabled: false) }
24
+ it { is_expected.to be_nil }
25
+ end
21
26
  end
@@ -1,2 +1,5 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
5
  require 'mini_style'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sinsoku
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
+ - ".rubocop.yml"
64
65
  - ".travis.yml"
65
66
  - Gemfile
66
67
  - LICENSE.txt