Skip to content

Commit 8c59587

Browse files
First commit
0 parents  commit 8c59587

File tree

399 files changed

+43678
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+43678
-0
lines changed

.github/workflows/ci.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ master ]
7+
8+
jobs:
9+
rubocop:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: 3.0
17+
bundler-cache: true
18+
- name: Install dependencies
19+
run: bundle install
20+
- name: Run RuboCop
21+
run: bundle exec rubocop

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
*.gem
10+
.idea/

.rubocop.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
AllCops:
2+
TargetRubyVersion: 3.0
3+
NewCops: enable
4+
SuggestExtensions: false
5+
Exclude:
6+
- 'vendor/**/*'
7+
8+
Metrics/BlockLength:
9+
Enabled: false
10+
11+
Style/StringLiterals:
12+
EnforcedStyle: double_quotes
13+
14+
Style/Documentation:
15+
Enabled: false
16+
17+
Layout/LineLength:
18+
Max: 160

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [1.0.0] - 2024-11-05
6+
### Added
7+
- Initial release with jquery if needed.

Gemfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gemspec
6+
7+
group :development do
8+
gem "rake", "~> 13.0"
9+
gem "rubocop", require: false
10+
end

Gemfile.lock

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
PATH
2+
remote: .
3+
specs:
4+
jquery-ui-suite (1.0.0)
5+
sprockets-rails
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actionpack (7.2.2)
11+
actionview (= 7.2.2)
12+
activesupport (= 7.2.2)
13+
nokogiri (>= 1.8.5)
14+
racc
15+
rack (>= 2.2.4, < 3.2)
16+
rack-session (>= 1.0.1)
17+
rack-test (>= 0.6.3)
18+
rails-dom-testing (~> 2.2)
19+
rails-html-sanitizer (~> 1.6)
20+
useragent (~> 0.16)
21+
actionview (7.2.2)
22+
activesupport (= 7.2.2)
23+
builder (~> 3.1)
24+
erubi (~> 1.11)
25+
rails-dom-testing (~> 2.2)
26+
rails-html-sanitizer (~> 1.6)
27+
activesupport (7.2.2)
28+
base64
29+
benchmark (>= 0.3)
30+
bigdecimal
31+
concurrent-ruby (~> 1.0, >= 1.3.1)
32+
connection_pool (>= 2.2.5)
33+
drb
34+
i18n (>= 1.6, < 2)
35+
logger (>= 1.4.2)
36+
minitest (>= 5.1)
37+
securerandom (>= 0.3)
38+
tzinfo (~> 2.0, >= 2.0.5)
39+
ast (2.4.2)
40+
base64 (0.2.0)
41+
benchmark (0.3.0)
42+
bigdecimal (3.1.8)
43+
builder (3.3.0)
44+
concurrent-ruby (1.3.4)
45+
connection_pool (2.4.1)
46+
crass (1.0.6)
47+
drb (2.2.1)
48+
erubi (1.13.0)
49+
i18n (1.14.6)
50+
concurrent-ruby (~> 1.0)
51+
json (2.7.6)
52+
language_server-protocol (3.17.0.3)
53+
logger (1.6.1)
54+
loofah (2.23.1)
55+
crass (~> 1.0.2)
56+
nokogiri (>= 1.12.0)
57+
minitest (5.25.1)
58+
nokogiri (1.16.7-x86_64-linux)
59+
racc (~> 1.4)
60+
parallel (1.26.3)
61+
parser (3.3.5.1)
62+
ast (~> 2.4.1)
63+
racc
64+
racc (1.8.1)
65+
rack (3.1.8)
66+
rack-session (2.0.0)
67+
rack (>= 3.0.0)
68+
rack-test (2.1.0)
69+
rack (>= 1.3)
70+
rails-dom-testing (2.2.0)
71+
activesupport (>= 5.0.0)
72+
minitest
73+
nokogiri (>= 1.6)
74+
rails-html-sanitizer (1.6.0)
75+
loofah (~> 2.21)
76+
nokogiri (~> 1.14)
77+
rainbow (3.1.1)
78+
rake (13.2.1)
79+
regexp_parser (2.9.2)
80+
rubocop (1.68.0)
81+
json (~> 2.3)
82+
language_server-protocol (>= 3.17.0)
83+
parallel (~> 1.10)
84+
parser (>= 3.3.0.2)
85+
rainbow (>= 2.2.2, < 4.0)
86+
regexp_parser (>= 2.4, < 3.0)
87+
rubocop-ast (>= 1.32.2, < 2.0)
88+
ruby-progressbar (~> 1.7)
89+
unicode-display_width (>= 2.4.0, < 3.0)
90+
rubocop-ast (1.33.1)
91+
parser (>= 3.3.1.0)
92+
ruby-progressbar (1.13.0)
93+
securerandom (0.3.1)
94+
sprockets (4.2.1)
95+
concurrent-ruby (~> 1.0)
96+
rack (>= 2.2.4, < 4)
97+
sprockets-rails (3.5.2)
98+
actionpack (>= 6.1)
99+
activesupport (>= 6.1)
100+
sprockets (>= 3.0.0)
101+
tzinfo (2.0.6)
102+
concurrent-ruby (~> 1.0)
103+
unicode-display_width (2.6.0)
104+
useragent (0.16.10)
105+
106+
PLATFORMS
107+
x86_64-linux
108+
109+
DEPENDENCIES
110+
jquery-ui-suite!
111+
rake (~> 13.0)
112+
rubocop
113+
114+
BUNDLED WITH
115+
2.5.18

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 George Mihai Grigore
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.

README.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Jquery::Ui::Suite
2+
3+
`Jquery::Ui::Suite` is a gem that integrates jQuery UI v1.14.1 and jQuery v3.7.1 assets seamlessly into your Rails application. This gem allows you to configure the jQuery UI theme you want to use and includes the latest versions of jQuery and jQuery UI by default.
4+
5+
## Table of Contents
6+
7+
- [Installation](#installation)
8+
- [Configuration](#configuration)
9+
- [Usage](#usage)
10+
- [Styles](#styles)
11+
- [Contact](#contact)
12+
13+
## Installation
14+
15+
Add `jquery-ui-suite` to your Gemfile and run `bundle install`:
16+
17+
```ruby
18+
gem 'jquery-ui-suite'
19+
```
20+
21+
After installing, run the generator to create an initializer for configuring the gem:
22+
23+
```bash
24+
rails generate jquery_ui_suite:install
25+
```
26+
27+
## Configuration
28+
The gem includes a configuration initializer located at config/initializers/jquery_ui_suite.rb, where you can customize the theme used for jQuery UI.
29+
30+
### Example Configuration
31+
In config/initializers/jquery_ui_suite.rb, set your desired theme:
32+
33+
```ruby
34+
Jquery::Ui::Suite.setup do |config|
35+
config.jquery_ui_theme = "base"
36+
config.include_jquery = true
37+
end
38+
```
39+
Available themes include `base`, `black-tie`, `blitzer`, `cupertino`, `dark-hive`, `dot-luv`, `eggplant`, `excite-bike`, `flick`, `hot-sneaks`, `humanity`,
40+
`le-frog`, `mint-choc`, `overcast`, `pepper-grinder`, `redmond`, `smoothness`, `south-street`, `start`, `sunny`, `swanky-purse`, `trontastic`, `ui-darkness`, `ui-lightness` and `vader`.
41+
42+
## Usage
43+
Import jQuery and jQuery UI
44+
In your application's importmap.rb file, pin the JavaScript files:
45+
46+
```ruby
47+
pin "jquery", to: "jquery-3.7.1.min.js", preload: true
48+
pin "jquery-ui", to: "jquery-ui-1.14.1.min.js", preload: true
49+
```
50+
51+
In app/javascript/application.js, import jQuery and jQuery UI:
52+
53+
```ruby
54+
import "jquery"
55+
import "jquery-ui"
56+
57+
// Make jQuery globally available
58+
window.$ = window.jQuery = $
59+
```
60+
61+
## Styles
62+
In app/assets/stylesheets/application.scss, import the theme you selected in the initializer:
63+
64+
```scss
65+
@import "jquery-ui/themes/base/jquery-ui.min"; // Replace 'base' with your selected theme
66+
@import "jquery-ui/themes/base/theme";
67+
```
68+
Available themes include `base`, `black-tie`, `blitzer`, `cupertino`, `dark-hive`, `dot-luv`, `eggplant`, `excite-bike`, `flick`, `hot-sneaks`, `humanity`,
69+
`le-frog`, `mint-choc`, `overcast`, `pepper-grinder`, `redmond`, `smoothness`, `south-street`, `start`, `sunny`, `swanky-purse`, `trontastic`, `ui-darkness`, `ui-lightness` and `vader`.
70+
71+
72+
## Contributing
73+
Contributions are welcome! Feel free to report bugs or submit pull requests.
74+
75+
## Contact
76+
77+
For questions or further information, feel free to reach out via [LinkedIn](https://www.linkedin.com/in/grigore-george-mihai-73981b86/).

Rakefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/gem_tasks"
4+
task default: %i[]

bin/console

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require "bundler/setup"
5+
require "jquery/ui/suite"
6+
7+
# You can add fixtures and/or initialization code here to make experimenting
8+
# with your gem easier. You can also use a different console, if you like.
9+
10+
require "irb"
11+
IRB.start(__FILE__)

bin/setup

+8
Original file line numberDiff line numberDiff line change
@@ -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

jquery-ui-suite.gemspec

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "lib/jquery/ui/suite/version"
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = "jquery-ui-suite"
7+
spec.version = Jquery::Ui::Suite::VERSION
8+
spec.authors = ["George Mihai Grigore"]
9+
spec.email = ["[email protected]"]
10+
11+
spec.summary = "Rails gem providing jQuery and jQuery UI integration with theme configuration."
12+
spec.description = "A Rails gem that integrates jQuery and jQuery UI into your application, offering easy theme configuration and importmap compatibility."
13+
spec.homepage = "https://github.com/Grigore-George-Mihai/jquery-ui-suite"
14+
spec.license = "MIT"
15+
spec.required_ruby_version = ">= 3.0.0"
16+
17+
# Metadata links for easy access to source and documentation
18+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
19+
spec.metadata["homepage_uri"] = spec.homepage
20+
spec.metadata["source_code_uri"] = spec.homepage
21+
22+
# Specify files to include in the gem
23+
spec.files = Dir["lib/**/*", "vendor/**/*", "README.md", "LICENSE"]
24+
spec.bindir = "exe"
25+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
26+
spec.require_paths = ["lib"]
27+
28+
# Dependencies
29+
spec.add_dependency "sprockets-rails"
30+
31+
# Optional development metadata
32+
spec.metadata["rubygems_mfa_required"] = "true"
33+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
require "rails/generators"
4+
5+
module JqueryUiSuite
6+
module Generators
7+
class InstallGenerator < Rails::Generators::Base
8+
source_root File.expand_path("templates", __dir__)
9+
10+
def create_initializer_file
11+
template "jquery_ui_suite_initializer.rb", "config/initializers/jquery_ui_suite.rb"
12+
end
13+
end
14+
end
15+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
Jquery::Ui::Suite.setup do |config|
4+
config.jquery_ui_theme = "base"
5+
config.include_jquery = true
6+
end

lib/jquery/ui/suite.rb

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "suite/version"
4+
require_relative "suite/engine"
5+
6+
module Jquery
7+
module Ui
8+
module Suite
9+
class Error < StandardError; end
10+
11+
class << self
12+
attr_accessor :config
13+
14+
def setup
15+
yield(config)
16+
end
17+
end
18+
19+
self.config = ActiveSupport::OrderedOptions.new
20+
config.jquery_ui_theme = "base"
21+
config.include_jquery = true
22+
end
23+
end
24+
end

0 commit comments

Comments
 (0)