mutils 0.2.25

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
+ SHA256:
3
+ metadata.gz: 1ad257d347c64dc901ac7ed7f4ebfa36344e46402dde6f9bcf44c501a8f7fabc
4
+ data.tar.gz: 0c9415d7761185bf5673fa788ae07db20dc7012b0986c4ef7dda7202711a4058
5
+ SHA512:
6
+ metadata.gz: af41435a989b0dbb7709ad07b7b88811f808f39b66fbe3b8ca6e5ef299e4774f249cf50262fa3ccb4165d133c96f4ed2d167ab2ec88378f5008bc45878fa503e
7
+ data.tar.gz: 8e3ef58f7af8103851982eae7fc23b09955a4884d50e7399855be14d202f0164248de6c84c98fe9cdff38f8bb3f3064582b8b69d18f3e933f8cb38f0ad2dea37
@@ -0,0 +1,30 @@
1
+ # Contributing
2
+
3
+ We love pull requests from everyone. By participating in this project, you
4
+ agree to abide by the [code of conduct].
5
+
6
+ [code of conduct]: https://github.com/niteshpurohit/mutils/blob/master/CODE_OF_CONDUCT.md
7
+
8
+ Fork, then clone the repo:
9
+
10
+ git clone git@github.com:niteshpurohit/mutils.git
11
+
12
+ Set up your machine:
13
+
14
+ ./bin/setup
15
+
16
+ Make sure the tests pass:
17
+
18
+ rake
19
+
20
+ Make your change. Add tests for your change. Make the tests pass:
21
+
22
+ rake
23
+
24
+ Push to your fork and [submit a pull request][pr].
25
+
26
+ [pr]: https://github.com/niteshpurohit/mutils/compare/
27
+
28
+ At this point you're waiting on us. We like to at least comment on pull requests
29
+ within three business days (and, typically, one business day). We may suggest
30
+ some changes or improvements or alternatives.
@@ -0,0 +1,32 @@
1
+ Issue tracker is **ONLY** used for reporting bugs. New features should be discussed on our slack channel. Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
2
+
3
+ <!--- Provide a general summary of the issue in the Title above -->
4
+
5
+ ## Expected Behavior
6
+ <!--- Tell us what should happen -->
7
+
8
+ ## Current Behavior
9
+ <!--- Tell us what happens instead of the expected behavior -->
10
+
11
+ ## Possible Solution
12
+ <!--- Not obligatory, but suggest a fix/reason for the bug, -->
13
+
14
+ ## Steps to Reproduce
15
+ <!--- Provide a link to a live example, or an unambiguous set of steps to -->
16
+ <!--- reproduce this bug. Include code to reproduce, if relevant -->
17
+ 1.
18
+ 2.
19
+ 3.
20
+ 4.
21
+
22
+ ## Context (Environment)
23
+ <!--- How has this issue affected you? What are you trying to accomplish? -->
24
+ <!--- Providing context helps us come up with a solution that is most useful in the real world -->
25
+
26
+ <!--- Provide a general summary of the issue in the Title above -->
27
+
28
+ ## Detailed Description
29
+ <!--- Provide a detailed description of the change or addition you are proposing -->
30
+
31
+ ## Possible Implementation
32
+ <!--- Not obligatory, but suggest an idea for implementing addition or change -->
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ Issue tracker is **ONLY** used for reporting bugs. New features should be discussed on our slack channel. Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
11
+
12
+ <!--- Provide a general summary of the issue in the Title above -->
13
+
14
+ ## Expected Behavior
15
+ <!--- Tell us what should happen -->
16
+
17
+ ## Current Behavior
18
+ <!--- Tell us what happens instead of the expected behavior -->
19
+
20
+ ## Possible Solution
21
+ <!--- Not obligatory, but suggest a fix/reason for the bug, -->
22
+
23
+ ## Steps to Reproduce
24
+ <!--- Provide a link to a live example, or an unambiguous set of steps to -->
25
+ <!--- reproduce this bug. Include code to reproduce, if relevant -->
26
+ 1.
27
+ 2.
28
+ 3.
29
+ 4.
30
+
31
+ ## Context (Environment)
32
+ <!--- How has this issue affected you? What are you trying to accomplish? -->
33
+ <!--- Providing context helps us come up with a solution that is most useful in the real world -->
34
+
35
+ <!--- Provide a general summary of the issue in the Title above -->
36
+
37
+ ## Detailed Description
38
+ <!--- Provide a detailed description of the change or addition you are proposing -->
39
+
40
+ ## Possible Implementation
41
+ <!--- Not obligatory, but suggest an idea for implementing addition or change -->
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,23 @@
1
+ * **Please check if the PR fulfills these requirements**
2
+ - [ ] The commit message follows our guidelines
3
+ - [ ] Tests for the changes have been added (for bug fixes / features)
4
+ - [ ] Docs have been added / updated (for bug fixes / features)
5
+
6
+
7
+ * **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
8
+
9
+
10
+
11
+ * **What is the current behavior?** (You can also link to an open issue here)
12
+
13
+
14
+
15
+ * **What is the new behavior (if this is a feature change)?**
16
+
17
+
18
+
19
+ * **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)
20
+
21
+
22
+
23
+ * **Other information**:
@@ -0,0 +1,27 @@
1
+ name: Ruby Gem
2
+ on:
3
+ release:
4
+ types: ["created"]
5
+
6
+ jobs:
7
+ build:
8
+ name: Build + Publish
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@master
13
+ - name: Set up Ruby 2.6
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ version: 2.6.x
17
+
18
+ - name: Publish to RubyGems
19
+ run: |
20
+ mkdir -p $HOME/.gem
21
+ touch $HOME/.gem/credentials
22
+ chmod 0600 $HOME/.gem/credentials
23
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
24
+ gem build *.gemspec
25
+ gem push *.gem
26
+ env:
27
+ GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
@@ -0,0 +1,20 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .idea/*
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ AllCops:
2
+ TargetRubyVersion: "2.5.0"
@@ -0,0 +1,82 @@
1
+ ```
2
+ ruby benchmark/benchmark-serializer-json.rb
3
+
4
+ Rehearsal ------------------------------------------------
5
+ as_json 0.298969 0.008275 0.307244 ( 0.307616)
6
+ fast_jsonapi 0.232278 0.000439 0.232717 ( 0.232886)
7
+ grape_entity 1.014712 0.001639 1.016351 ( 1.017073)
8
+ blueprinter 0.342568 0.000333 0.342901 ( 0.343215)
9
+ mutils 2.846847 3.318636 6.165483 ( 4.499497)
10
+ roar 1.165221 0.021089 1.186310 ( 1.186998)
11
+ panko 0.262190 0.005572 0.267762 ( 0.267947)
12
+ --------------------------------------- total: 9.518768sec
13
+
14
+ user system total real
15
+ as_json 0.160771 0.000220 0.160991 ( 0.161083)
16
+ fast_jsonapi 0.202366 0.000215 0.202581 ( 0.202866)
17
+ grape_entity 0.908631 0.005240 0.913871 ( 0.914388)
18
+ blueprinter 0.270655 0.000117 0.270772 ( 0.270940)
19
+ mutils 2.629444 3.284792 5.914236 ( 4.256369)
20
+ roar 1.006414 0.001231 1.007645 ( 1.008334)
21
+ panko 0.169449 0.000395 0.169844 ( 0.170023)
22
+
23
+ Warming up --------------------------------------
24
+ as_json 1.000 i/100ms
25
+ fast_jsonapi 1.000 i/100ms
26
+ grape_entity 1.000 i/100ms
27
+ blueprinter 1.000 i/100ms
28
+ mutils 1.000 i/100ms
29
+ roar 1.000 i/100ms
30
+ panko 1.000 i/100ms
31
+ Calculating -------------------------------------
32
+ as_json 4.602 (± 3.1%) i/s - 46.000 in 10.084341s
33
+ fast_jsonapi 3.736 (± 1.1%) i/s - 38.000 in 10.182740s
34
+ grape_entity 0.983 (± 2.6%) i/s - 10.000 in 10.179913s
35
+ blueprinter 3.018 (± 2.3%) i/s - 31.000 in 10.305027s
36
+ mutils 0.224 (± 2.1%) i/s - 3.000 in 13.383544s
37
+ roar 0.887 (± 2.1%) i/s - 9.000 in 10.166892s
38
+ panko 4.874 (± 3.1%) i/s - 49.000 in 10.176593s
39
+ with 95.0% confidence
40
+
41
+ Comparison:
42
+ panko: 4.9 i/s
43
+ as_json: 4.6 i/s - same-ish: difference falls within error
44
+ fast_jsonapi: 3.7 i/s - 1.30x (± 0.04) slower
45
+ blueprinter: 3.0 i/s - 1.61x (± 0.06) slower
46
+ grape_entity: 1.0 i/s - 4.95x (± 0.20) slower
47
+ roar: 0.9 i/s - 5.50x (± 0.20) slower
48
+ mutils: 0.2 i/s - 21.74x (± 0.81) slower
49
+ with 95.0% confidence
50
+
51
+ Calculating -------------------------------------
52
+ as_json 53.369M memsize ( 0.000 retained)
53
+ 841.041k objects ( 0.000 retained)
54
+ 8.000 strings ( 0.000 retained)
55
+ fast_jsonapi 33.617M memsize ( 0.000 retained)
56
+ 490.404k objects ( 0.000 retained)
57
+ 50.000 strings ( 0.000 retained)
58
+ grape_entity 83.654M memsize ( 0.000 retained)
59
+ 1.031M objects ( 0.000 retained)
60
+ 4.000 strings ( 0.000 retained)
61
+ blueprinter 31.341M memsize ( 0.000 retained)
62
+ 280.327k objects ( 0.000 retained)
63
+ 0.000 strings ( 0.000 retained)
64
+ mutils 162.079M memsize ( 0.000 retained)
65
+ 1.282M objects ( 0.000 retained)
66
+ 0.000 strings ( 0.000 retained)
67
+ roar 123.865M memsize ( 0.000 retained)
68
+ 1.061M objects ( 0.000 retained)
69
+ 1.000 strings ( 0.000 retained)
70
+ panko 53.374M memsize ( 0.000 retained)
71
+ 841.114k objects ( 0.000 retained)
72
+ 13.000 strings ( 0.000 retained)
73
+
74
+ Comparison:
75
+ blueprinter: 31340936 allocated
76
+ fast_jsonapi: 33617288 allocated - 1.07x more
77
+ as_json: 53369496 allocated - 1.70x more
78
+ panko: 53374416 allocated - 1.70x more
79
+ grape_entity: 83653952 allocated - 2.67x more
80
+ roar: 123864600 allocated - 3.95x more
81
+ mutils: 162078928 allocated - 5.17x more
82
+ ```
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at nitesh.purohit.it@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mutils.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mutils (0.2.24)
5
+ activesupport (>= 4.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (6.0.1)
11
+ actionview (= 6.0.1)
12
+ activesupport (= 6.0.1)
13
+ rack (~> 2.0)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
+ actionview (6.0.1)
18
+ activesupport (= 6.0.1)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
+ activesupport (6.0.1)
24
+ concurrent-ruby (~> 1.0, >= 1.0.2)
25
+ i18n (>= 0.7, < 2)
26
+ minitest (~> 5.1)
27
+ tzinfo (~> 1.1)
28
+ zeitwerk (~> 2.2)
29
+ builder (3.2.3)
30
+ concurrent-ruby (1.1.5)
31
+ crass (1.0.5)
32
+ diff-lcs (1.3)
33
+ erubi (1.9.0)
34
+ i18n (1.7.0)
35
+ concurrent-ruby (~> 1.0)
36
+ loofah (2.3.1)
37
+ crass (~> 1.0.2)
38
+ nokogiri (>= 1.5.9)
39
+ method_source (0.9.2)
40
+ mini_portile2 (2.4.0)
41
+ minitest (5.13.0)
42
+ nokogiri (1.10.5)
43
+ mini_portile2 (~> 2.4.0)
44
+ rack (2.0.7)
45
+ rack-test (1.1.0)
46
+ rack (>= 1.0, < 3)
47
+ rails-dom-testing (2.0.3)
48
+ activesupport (>= 4.2.0)
49
+ nokogiri (>= 1.6)
50
+ rails-html-sanitizer (1.3.0)
51
+ loofah (~> 2.3)
52
+ railties (6.0.1)
53
+ actionpack (= 6.0.1)
54
+ activesupport (= 6.0.1)
55
+ method_source
56
+ rake (>= 0.8.7)
57
+ thor (>= 0.20.3, < 2.0)
58
+ rake (10.5.0)
59
+ rspec-core (3.9.0)
60
+ rspec-support (~> 3.9.0)
61
+ rspec-expectations (3.9.0)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.9.0)
64
+ rspec-mocks (3.9.0)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.9.0)
67
+ rspec-rails (3.9.0)
68
+ actionpack (>= 3.0)
69
+ activesupport (>= 3.0)
70
+ railties (>= 3.0)
71
+ rspec-core (~> 3.9.0)
72
+ rspec-expectations (~> 3.9.0)
73
+ rspec-mocks (~> 3.9.0)
74
+ rspec-support (~> 3.9.0)
75
+ rspec-support (3.9.0)
76
+ thor (0.20.3)
77
+ thread_safe (0.3.6)
78
+ tzinfo (1.2.5)
79
+ thread_safe (~> 0.1)
80
+ zeitwerk (2.2.1)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ bundler (~> 2.0)
87
+ mutils!
88
+ rake (~> 10.0)
89
+ rspec-rails
90
+
91
+ BUNDLED WITH
92
+ 2.0.2