myopic 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 895e5adee8bf920bffe24631ef6e81e38b7fe90be0d432e2ab9a945c61c37ffc
4
- data.tar.gz: 2ede5f613767eb6c14b19ad0de3503668c4db2ac757c5131f32fd3fcfdcc6d92
3
+ metadata.gz: 709d0c3ad85d8b901017370f6ac41681d1469748c32484e20795807f6797dc70
4
+ data.tar.gz: 44b08b471ccaf0356df7c8c18ab15d404bd9c21806ded8022a0d2076b9aa66c4
5
5
  SHA512:
6
- metadata.gz: b5aa15d1f48f7d61d46bc45472ae31359f15cd88245cd6f1be1914f241732622a34a5f96982411d3a708023bea2b479c05af8e3a68a32305c9f34d8f31295803
7
- data.tar.gz: 1bcf904d10d7839281a3392c656fe9edeb676ec0d581480335020111685cce3071588fbd5d8eb4e511640c259d57c66d85d365dfc72ba472d0622b336ea158a7
6
+ metadata.gz: dd7910b594136cb14745ce6f3a8a1740a2ff909abd340f3381352749335bb8fbcb24b7f53a8f61682b24cbe5e8d455119b5d9be59231f62b7d0e4aace4f9ec8c
7
+ data.tar.gz: 293461dc751261d0454607b539bdad618ec6a9f92561b2557a41cced0d3914e094d29e12575c3905920faccce4785c0dfe550cdbaf99394ea7a6a4bde99e3bf4
data/CHANGELOG.md CHANGED
@@ -3,3 +3,9 @@
3
3
  ## [0.1.0] - 2023-07-12
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.1.1] - 2023-07-16
8
+
9
+ - Added the ability to patch the form scaffolding template with a SELECT dropdown
10
+
11
+
data/README.md CHANGED
@@ -1,30 +1,28 @@
1
1
  # Myopic
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
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/myopic`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Myopic is a Rails utility library to get you to your first prototype quickly.
6
4
 
7
5
  ## Installation
8
6
 
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
7
  Install the gem and add to the application's Gemfile by executing:
12
8
 
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
9
+ $ bundle add myopic
18
10
 
19
11
  ## Usage
20
12
 
21
- TODO: Write usage instructions here
13
+ To include Simple CSS tags, add this to your view layout file:
14
+ <%= Myopic::simple_css %>
22
15
 
23
- ## Development
16
+ To get links to all of the resource-routes (we find them by filtering on anything starting with "new_"), add this:
17
+ <nav>
18
+ <% Myopic::rails_resources.each do |resource| %>
19
+ <%= Myopic::link_to_resource resource %> &nbsp; | &nbsp;
20
+ <% end %>
21
+ </nav>
24
22
 
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.
23
+ ## Development
26
24
 
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).
25
+ This section coming soon.
28
26
 
29
27
  ## Contributing
30
28
 
@@ -34,6 +32,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
34
32
 
35
33
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
34
 
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the Myopic project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/myopic/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Myopic
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #patch_rails_form_template
4
+
5
+ tpl_form_file=$(find $(gem env home)/gems -name 'railties-[0-9\.]*' | sort -r | head -1)/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
6
+ #tpl_form_file=$(find $(gem env home)/gems -name 'railties-[0-9].[0-9].[0-9].[0-9]' | sort -r | head -1)/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
7
+
8
+ check_extract=$(sed '27q;d' $tpl_form_file)
9
+
10
+ if [ "$check_extract" == '<% else -%>' ]; then # zsh needs a single equals
11
+ echo 'matches expected format'
12
+ else
13
+ echo 'unexpected file structure'
14
+ exit
15
+ fi
16
+
17
+ cat <<EOF > tpl_form_file.patch
18
+ 26a27,29
19
+ > <% elsif attribute.reference? -%>
20
+ > <%%= form.label :<%= attribute.column_name %>, style: "display: block" %>
21
+ > <%%= form.collection_select :<%= attribute.column_name %>, <%= attribute.name.camelize %>.all, :id, :name, prompt: true %>
22
+ EOF
23
+
24
+ #cp $tpl_form_file .
25
+ #patch _form.html.erb.tt tpl_form_file.patch
26
+
27
+ patch $tpl_form_file tpl_form_file.patch
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myopic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katkam Nitin Reddy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-12 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -26,6 +26,7 @@ files:
26
26
  - Rakefile
27
27
  - lib/myopic.rb
28
28
  - lib/myopic/version.rb
29
+ - lib/patch_rails_form_template.bash
29
30
  - sig/myopic.rbs
30
31
  homepage:
31
32
  licenses: