ruby-skyline-core 0.1.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3f20c2002bf4a8fe2dd4b3bc59fd31cc98c048fb
4
+ data.tar.gz: d6db77f0533db092a4121a76caee4b9830f18cda
5
+ SHA512:
6
+ metadata.gz: 38c01c05aaf9ab6a55a4ef90e3a9281c959e59430d9184b59d158c13e99c1bdcb17e4822bfd898bbab4e56e7dcc91fca7fc3129b1f6dabffd9886fc4a290e194
7
+ data.tar.gz: 329f70095f5b75f5c8bc30f84a7f362fce1f7302c12fb762f35a887219d51cff5954e0166197f4c1e1279348e238bf94234641163cbf6a3d9df18ec23042962c
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ before_install: gem install bundler -v 1.12.5
3
+ rvm:
4
+ - 2.3.1
5
+ - 2.3.0
6
+ - 2.2.0
7
+ - 2.1.5
8
+ - 2.0.0
9
+ - jruby-19mode
10
+ - jruby-9.0.4.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby-skyline-core.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 shadow3x3x3
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ <a href="https://codeclimate.com/github/shadow3x3x3/ruby-skyline-core"><img src="https://codeclimate.com/github/shadow3x3x3/ruby-skyline-core/badges/gpa.svg" /></a>
2
+ [![Build Status](https://travis-ci.org/shadow3x3x3/ruby-skyline-core.svg?branch=master)](https://travis-ci.org/shadow3x3x3/ruby-skyline-core)
3
+
4
+ # Ruby Skyline Core
5
+
6
+ Comparing two datas that are multiple attributes. With Skyline Query definition.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'ruby-skyline-core'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install ruby-skyline-core
23
+
24
+ ## Usage
25
+
26
+ Using any Fixnum Array to check dominating with other Array
27
+
28
+ ```ruby
29
+ [1, 3].dominate?[4, 5] # true
30
+ [4, 5].dominate?[1, 2] # true
31
+ ```
32
+
33
+ If no array can dominate each other, it return nil.
34
+
35
+ ```ruby
36
+ [2, 3].dominate?[1, 4] # nil
37
+ ```
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby-skyline-core.
48
+
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
53
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ruby/skyline/core"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ module Ruby
2
+ module Skyline
3
+ module Core
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require "ruby/skyline/core/version"
2
+
3
+ module Ruby
4
+ module Skyline
5
+ module Core
6
+ # Your code goes here...
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,37 @@
1
+ # EXT Array
2
+ class Array
3
+ # dominate function in skyline for array
4
+ def dominate?(array)
5
+ raise ArgumentError, "Need Array not #{array.class}" unless array.class == Array
6
+ raise ArgumentError, 'Two Arrays are not the same size' unless size == array.size
7
+ flag = 0
8
+ check_flag = size
9
+ each_with_index do |attr, index|
10
+ flag += 1 if attr > array[index]
11
+ flag -= 1 if attr < array[index]
12
+ check_flag -= 1 if attr == array[index]
13
+ end
14
+ return false if flag == check_flag # be dominated
15
+ return true if flag == 0 - check_flag # dominate
16
+ nil
17
+ end
18
+
19
+ # skyline attributes aggregate for array
20
+ def aggregate(array)
21
+ aggregate_array = []
22
+ raise ArgumentError, "Need Array not #{array.class}" unless array.class == Array
23
+ raise ArgumentError, 'Two Arrays are not the same size' unless size == array.size
24
+ each_with_index do |attr, index|
25
+ aggregate_array << (attr + array[index]).round(6)
26
+ end
27
+ aggregate_array
28
+ end
29
+ end
30
+
31
+ module Ruby
32
+ module Skyline
33
+ module Core
34
+ VERSION = "0.1.0"
35
+ end
36
+ end
37
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module RubySkylineCore
2
+ VERSION = '0.1.1'
3
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruby-skyline-core"
8
+ spec.version = RubySkylineCore::VERSION
9
+ spec.authors = ["shadow3x3x3"]
10
+ spec.email = ["shadow3x3x3@gmail.com"]
11
+
12
+ spec.summary = %q{Skyline Query Core}
13
+ spec.description = %q{Comparing two datas that are multiple attributes. With Skyline Query definition.}
14
+ spec.homepage = "http://github.com/shadow3x3x3/ruby-skyline-core"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + Dir['lib/*.rb']
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.12"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-skyline-core
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - shadow3x3x3
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-09-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Comparing two datas that are multiple attributes. With Skyline Query
56
+ definition.
57
+ email:
58
+ - shadow3x3x3@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/setup
72
+ - lib/ruby-skyline-core.rb
73
+ - lib/ruby/skyline/core.rb
74
+ - lib/ruby/skyline/core/version.rb
75
+ - lib/version.rb
76
+ - ruby-skyline-core.gemspec
77
+ homepage: http://github.com/shadow3x3x3/ruby-skyline-core
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.5.1
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Skyline Query Core
101
+ test_files: []