partition_magic 0.1.0 → 0.1.2

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
  SHA256:
3
- metadata.gz: 5faf35805880a910a043b59313f772bbee330143ba8ec700e51e0944776a4d93
4
- data.tar.gz: c78719c6d15d2f0a59315742b52ce731f272d46dd010521e8823d4f507b555eb
3
+ metadata.gz: 4886372506343710b590d5330f69a0e5448bc152589b4d1418058db401e04570
4
+ data.tar.gz: 30a0ebacfbf22bd05e11970c6ea796f8ac711de9b9febe392fcafc6acf2fb3f1
5
5
  SHA512:
6
- metadata.gz: e72bf005718d3efdaee6a377680f3403809f67763241cabb1d593b835ba6a0122b041786372caf786893eced3247fe5a6533fcfa820d9a615b1ce1d66d47226a
7
- data.tar.gz: d329a0b5233b54eed9456ec1bbff1378cd41ce78c39d46794dcc45500145df0b86a6b39491dab1710628b8dcba760cb44e3dff082fe922ddf78a482f6e94d624
6
+ metadata.gz: 4760b035bf945399b16f286b2bccd6884948796e82ce20d34d6ae61595bfa86bce70cb0a5ffb461bfd78c7f4381f84b0544b1b0f3235158549fd2310fe9fc2ad
7
+ data.tar.gz: 4e82a4e5dc09eff8cbcd1324af89cb6298b05e472a8a9c8a64b078bdf7ccba1e1856729351a44770136da0509f329e87fe902c63b03c2a3892631259dd702c01
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/partition_magic.iml" filepath="$PROJECT_DIR$/.idea/partition_magic.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="jdk" jdkName="rbenv: 3.2.2" jdkType="RUBY_SDK" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.22, rbenv: 3.2.2) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.20.0, rbenv: 3.2.2) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.1.0, rbenv: 3.2.2) [gem]" level="application" />
17
+ </component>
18
+ <component name="RakeTasksCache">
19
+ <option name="myRootTask">
20
+ <RakeTaskImpl id="rake">
21
+ <subtasks>
22
+ <RakeTaskImpl description="Build partition_magic-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
23
+ <RakeTaskImpl id="build">
24
+ <subtasks>
25
+ <RakeTaskImpl description="Generate SHA512 checksum if partition_magic-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
26
+ </subtasks>
27
+ </RakeTaskImpl>
28
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
29
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
30
+ <RakeTaskImpl description="Build and install partition_magic-0.1.0.gem into system gems" fullCommand="install" id="install" />
31
+ <RakeTaskImpl id="install">
32
+ <subtasks>
33
+ <RakeTaskImpl description="Build and install partition_magic-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
34
+ </subtasks>
35
+ </RakeTaskImpl>
36
+ <RakeTaskImpl description="Create tag v0.1.0 and build and push partition_magic-0.1.0.gem to https://github.com/codephilosopher/partition_magic" fullCommand="release[remote]" id="release[remote]" />
37
+ <RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
38
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
39
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
40
+ <RakeTaskImpl id="release">
41
+ <subtasks>
42
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
43
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
44
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
45
+ </subtasks>
46
+ </RakeTaskImpl>
47
+ </subtasks>
48
+ </RakeTaskImpl>
49
+ </option>
50
+ </component>
51
+ </module>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
data/README.md CHANGED
@@ -1,39 +1,13 @@
1
1
  # PartitionMagic
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
3
+ Welcome to PartitionMagic gem. This Library will help you to partition an array of inetegers to odd and even arrays. A small Array partition library (DO NOT USE IN PRODUCTION ENVIRONMENT, THIS IS ONLY FOR EDUCATIONAL PURPOSE)"
4
+
5
+ eg: [1,2,3,4,5,6].partition_even_odd(&:even?)
6
+ [[2,4,6],[1,3,5]]
4
7
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/partition_magic`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
8
+ ## Install
9
+ gem install partition_magic
18
10
 
19
11
  ## Usage
20
12
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
-
29
- ## Contributing
30
-
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/partition_magic. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/partition_magic/blob/master/CODE_OF_CONDUCT.md).
32
-
33
- ## License
34
-
35
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
-
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the PartitionMagic project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/partition_magic/blob/master/CODE_OF_CONDUCT.md).
13
+ require 'partition_magic'
@@ -0,0 +1,3 @@
1
+ class Array
2
+ include PartitionMagic
3
+ end
@@ -0,0 +1,15 @@
1
+ module PartitionMagic
2
+ def partition_even_odd (&block)
3
+ even = []
4
+ odd = []
5
+ each do |n|
6
+ result = block.call(n)
7
+ if result == true
8
+ even << n
9
+ else
10
+ odd << n
11
+ end
12
+ end
13
+ [even, odd]
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PartitionMagic
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -9,15 +9,16 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["pradeek.k@gmail.com"]
10
10
 
11
11
  spec.summary = "A small Array partition library"
12
- spec.description = "A small Array partition library"
13
- # spec.homepage = "https://github.com/codephilosopher/partition_magic"
12
+ spec.description = "A small Array partition library (DO NOT
13
+ USE IN PRODUCTION ENVIRONMENT, THIS IS ONLY FOR EDUCATIONAL PURPOSE)"
14
+ spec.homepage = "https://github.com/codephilosopher/partition_magic"
14
15
  spec.license = "MIT"
15
16
  spec.required_ruby_version = ">= 2.6.0"
16
17
 
17
18
  # spec.metadata["allowed_push_host"] = "https://github.com/codephilosopher/partition_magic"
18
19
 
19
20
  # spec.metadata["homepage_uri"] = spec.homepage
20
- # spec.metadata["source_code_uri"] = "https://github.com/codephilosopher/partition_magic"
21
+ spec.metadata["source_code_uri"] = "https://github.com/codephilosopher/partition_magic"
21
22
  # spec.metadata["changelog_uri"] = "https://github.com/codephilosopher/partition_magic"
22
23
 
23
24
  # Specify which files should be added to the gem when it is released.
metadata CHANGED
@@ -1,35 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: partition_magic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pradeek
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-11-25 00:00:00.000000000 Z
10
+ date: 2025-02-03 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description: A small Array partition library
12
+ description: "A small Array partition library (DO NOT \nUSE IN PRODUCTION ENVIRONMENT,
13
+ THIS IS ONLY FOR EDUCATIONAL PURPOSE)"
14
14
  email:
15
15
  - pradeek.k@gmail.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - ".idea/.gitignore"
21
+ - ".idea/modules.xml"
22
+ - ".idea/partition_magic.iml"
23
+ - ".idea/vcs.xml"
20
24
  - CODE_OF_CONDUCT.md
21
25
  - LICENSE.txt
22
26
  - README.md
23
27
  - Rakefile
24
28
  - lib/partition_magic.rb
29
+ - lib/partition_magic/array.rb
30
+ - lib/partition_magic/partition_magic.rb
25
31
  - lib/partition_magic/version.rb
26
32
  - partition_magic.gemspec
27
33
  - sig/partition_magic.rbs
28
- homepage:
34
+ homepage: https://github.com/codephilosopher/partition_magic
29
35
  licenses:
30
36
  - MIT
31
- metadata: {}
32
- post_install_message:
37
+ metadata:
38
+ source_code_uri: https://github.com/codephilosopher/partition_magic
33
39
  rdoc_options: []
34
40
  require_paths:
35
41
  - lib
@@ -44,8 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
50
  - !ruby/object:Gem::Version
45
51
  version: '0'
46
52
  requirements: []
47
- rubygems_version: 3.4.19
48
- signing_key:
53
+ rubygems_version: 3.6.3
49
54
  specification_version: 4
50
55
  summary: A small Array partition library
51
56
  test_files: []