volt-simple_list_item_selector 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6b42de69b4203cf0bdb326bb5b250f2d39c1865a
4
+ data.tar.gz: f065ebf91cc64967e68a188cdf956e1e5431f151
5
+ SHA512:
6
+ metadata.gz: 36a0861a64bbdc2780e0cfc19bba6a0c64eb85eb67af6eb930562d7724f90236a63ff927c14cc0ba50afeb211eb6806377b98083a5414457f7d0d4f7a1303c3b
7
+ data.tar.gz: 5abebf9fe314ad5d7ae78a0de45265a4a3fe2f9350cee4d100b620bc377fbd1838749fee8584bb96328e9487e39997d846bb205563df7f9ed905f01b040646a9
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,15 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
12
+
13
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
14
+
15
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.1.0, available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in volt-simple_list_item_selector.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Neurodynamic
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Volt::SimpleListItemSelector
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ gem 'volt-simple_list_item_selector'
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install volt-simple_list_item_selector
16
+
17
+ ## Usage
18
+
19
+ Bare bones:
20
+ ```
21
+ <:simple_list_item_selector options="{{an_array_of_strings}}" />
22
+ ```
23
+
24
+
25
+ With all available options:
26
+ ```
27
+ <:simple_list_item_selector options="{{an_array_of_strings}}" selected_option="{{default_selection}}" selected_class="class_to_add_to_currently_selected_list_item" ul_class="class_to_add_to_ul_element" />
28
+ ```
29
+
30
+
31
+ Example:
32
+ ```
33
+ <:simple_list_item_selector options="{{['apples','oranges','pears']}}" selected_option="{{'apples'}}" selected_class="active" ul_class="fantastic" />
34
+ ```
35
+
36
+ Produces:
37
+ ```html
38
+ <ul class="list-item-selector fantastic">
39
+ <li class="option active">
40
+ <a href="#">apples</a>
41
+ </li>
42
+ <li class="option">
43
+ <a href="#">oranges</a>
44
+ </li>
45
+ <li class="option">
46
+ <a href="#">pears</a>
47
+ </li>
48
+ </ul>
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it ( http://github.com/neurodynamic/volt-simple_list_item_selector/fork )
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ module SimpleListItemSelector
2
+ class MainController < Volt::ModelController
3
+
4
+ def select(option)
5
+ attrs.selected_option = option
6
+ end
7
+
8
+ def selected_class(option)
9
+ if option == attrs.selected_option
10
+ attrs.selected_class || 'selected'
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ <ul class="list-item-selector {{attrs.ul_class}}">
2
+ {{ attrs.options.each do |option| }}
3
+ <li e-click="select(option)" class="option {{selected_class(option)}}">
4
+ <a href="#">{{ option }}</a>
5
+ </li>
6
+ {{ end }}
7
+ </ul>
@@ -0,0 +1,5 @@
1
+ module Volt
2
+ module SimpleListItemSelector
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ # If you need to require in code in the gem's app folder, keep in mind that
2
+ # the app is not on the load path when the gem is required. Use
3
+ # app/{gemname}/config/initializers/boot.rb to require in client or server
4
+ # code.
5
+ #
6
+ # Also, in volt apps, you typically use the lib folder in the
7
+ # app/{componentname} folder instead of this lib folder. This lib folder is
8
+ # for setting up gem code when Bundler.require is called. (or the gem is
9
+ # required.)
10
+ #
11
+ # If you need to configure volt in some way, you can add a Volt.configure block
12
+ # in this file.
13
+
14
+ module Volt
15
+ module SimpleListItemSelector
16
+ # Your code goes here...
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # Volt sets up rspec and capybara for testing.
2
+ require 'volt/spec/setup'
3
+ Volt.spec_setup
4
+
5
+ RSpec.configure do |config|
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ # Run specs in random order to surface order dependencies. If you find an
10
+ # order dependency and want to debug it, you can fix the order by providing
11
+ # the seed, which is printed after each run.
12
+ # --seed 1234
13
+ config.order = 'random'
14
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Volt::SimpleListItemSelector do
4
+ it 'should have a version number' do
5
+ expect(Volt::SimpleListItemSelector::VERSION).not_to be nil
6
+ end
7
+
8
+ it 'should do something useful' do
9
+ expect(false).to be true
10
+ end
11
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'volt/simple_list_item_selector/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "volt-simple_list_item_selector"
8
+ spec.version = Volt::SimpleListItemSelector::VERSION
9
+ spec.authors = ["Neurodynamic"]
10
+ spec.email = ["developer@neurodynamic.io"]
11
+ spec.summary = %q{Simple Volt Framework selector widget made of list items.}
12
+ spec.description = %q{}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "volt", "~> 0.9.0"
22
+ spec.add_development_dependency 'rspec', '~> 3.2.0'
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: volt-simple_list_item_selector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Neurodynamic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: volt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: ''
56
+ email:
57
+ - developer@neurodynamic.io
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - app/simple_list_item_selector/controllers/main_controller.rb
70
+ - app/simple_list_item_selector/views/main/index.html
71
+ - lib/volt/simple_list_item_selector.rb
72
+ - lib/volt/simple_list_item_selector/version.rb
73
+ - spec/spec_helper.rb
74
+ - spec/volt/simple_list_item_selector_spec.rb
75
+ - volt-simple_list_item_selector.gemspec
76
+ homepage: ''
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.5
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Simple Volt Framework selector widget made of list items.
100
+ test_files:
101
+ - spec/spec_helper.rb
102
+ - spec/volt/simple_list_item_selector_spec.rb