static_files_toys 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4c2213ed99f9d28df9471b424eec962be1e386218fb8953a59991fd036ba39d8
4
+ data.tar.gz: 56021ea882adf0cce545a90c8a62c9e886c83af807ab8dee9115af39427a01c2
5
+ SHA512:
6
+ metadata.gz: ba003c5082c6d9d82a2433fd8be12e8fa59fadf8f92ab6ec842f33d501b6703ae163ed2dcf37ac3cdf9adcd8f5cd34404ced826c65455646fee24ad8ff24b135
7
+ data.tar.gz: 5c953a4c25dce69f9b497481d8c92cdf0ebd7d4b9ec305d59a9a09a89640e4935a8c7bbff3e9507932d21e5954a4c22b939d6b99fbc3cc89956b5ae0008d81ab
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## master (unreleased)
4
+
5
+ ## 0.1.0 (2020-07-13)
6
+
7
+ * Initial release.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Alexander Popov
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.
@@ -0,0 +1,58 @@
1
+ # Static Files Toys
2
+
3
+ [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/static_files_toys?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/static_files_toys)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/static_files_toys/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/static_files_toys)
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/static_files_toys.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/static_files_toys)
6
+ [![Depfu](https://img.shields.io/depfu/AlexWayfer/benchmark_toys?style=flat-square)](https://depfu.com/repos/github/AlexWayfer/static_files_toys)
7
+ [![Inline docs](https://inch-ci.org/github/AlexWayfer/static_files_toys.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/static_files_toys)
8
+ [![license](https://img.shields.io/github/license/AlexWayfer/static_files_toys.svg?style=flat-square)](https://github.com/AlexWayfer/static_files_toys/blob/master/LICENSE.txt)
9
+ [![Gem](https://img.shields.io/gem/v/static_files_toys.svg?style=flat-square)](https://rubygems.org/gems/static_files_toys)
10
+
11
+ Toys template for static (public) files of a web-application.
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'static_files_toys'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ ```shell
24
+ bundle install
25
+ ```
26
+
27
+ Or install it yourself as:
28
+
29
+ ```shell
30
+ gem install static_files_toys
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ```ruby
36
+ require 'static_files_toys'
37
+ expand StaticFilesToys::Template
38
+ ```
39
+
40
+ ## Development
41
+
42
+ After checking out the repo, run `bundle install` to install dependencies.
43
+
44
+ Then, run `toys rspec` to run the tests.
45
+
46
+ To install this gem onto your local machine, run `toys gem install`.
47
+
48
+ To release a new version, run `toys gem release %version%`.
49
+ See how it works [here](https://github.com/AlexWayfer/gem_toys#release).
50
+
51
+ ## Contributing
52
+
53
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/static_files_toys).
54
+
55
+ ## License
56
+
57
+ The gem is available as open source under the terms of the
58
+ [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'static_files_toys/template'
4
+ require_relative 'static_files_toys/version'
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'toys-core'
4
+
5
+ module StaticFilesToys
6
+ ## Define toys for static files
7
+ class Template
8
+ include Toys::Template
9
+
10
+ GREP_OPTIONS = <<~STR
11
+ -ir --exclude-dir={\.git,log,node_modules,extra} --color=always
12
+ STR
13
+
14
+ on_expand do
15
+ tool :static_files do
16
+ tool :check do
17
+ desc 'Check static files'
18
+
19
+ def run
20
+ require 'highline'
21
+ @highline = HighLine.new
22
+
23
+ Dir["#{context_directory}/public/**/*"].each do |file|
24
+ next if File.directory? file
25
+
26
+ basename = File.basename(file)
27
+
28
+ puts "Looking for #{basename}..."
29
+
30
+ found = `grep #{GREP_OPTIONS} '#{basename}' #{context_directory}`
31
+
32
+ next unless found.empty? && File.dirname(file) != @skipping_dir
33
+
34
+ ask_question file
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def ask_question(file)
41
+ filename = file.sub(context_directory, '')
42
+
43
+ @highline.choose do |menu|
44
+ menu.layout = :one_line
45
+
46
+ menu.prompt = "Delete #{filename} ? "
47
+
48
+ menu.choice(:yes) { `git rm #{file.gsub(' ', '\ ')}` }
49
+ menu.choice(:no) {}
50
+ menu.choice(:skip) { @skipping_dir = File.dirname(file) }
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module StaticFilesToys
4
+ VERSION = '0.1.0'
5
+ end
metadata ADDED
@@ -0,0 +1,222 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: static_files_toys
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Popov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: highline
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: toys-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.10.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.10.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry-byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gem_toys
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: toys
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.10.4
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.10.4
97
+ - !ruby/object:Gem::Dependency
98
+ name: codecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.9'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.9'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.18.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.18.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.88.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.88.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-performance
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.0'
181
+ description: 'Toys template for static (public) files of a web-application.
182
+
183
+ '
184
+ email:
185
+ - alex.wayfer@gmail.com
186
+ executables: []
187
+ extensions: []
188
+ extra_rdoc_files: []
189
+ files:
190
+ - CHANGELOG.md
191
+ - LICENSE.txt
192
+ - README.md
193
+ - lib/static_files_toys.rb
194
+ - lib/static_files_toys/template.rb
195
+ - lib/static_files_toys/version.rb
196
+ homepage: https://github.com/AlexWayfer/static_files_toys
197
+ licenses:
198
+ - MIT
199
+ metadata:
200
+ source_code_uri: https://github.com/AlexWayfer/static_files_toys
201
+ homepage_uri: https://github.com/AlexWayfer/static_files_toys
202
+ changelog_uri: https://github.com/AlexWayfer/static_files_toys/blob/master/CHANGELOG.md
203
+ post_install_message:
204
+ rdoc_options: []
205
+ require_paths:
206
+ - lib
207
+ required_ruby_version: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: '2.5'
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ requirements: []
218
+ rubygems_version: 3.1.2
219
+ signing_key:
220
+ specification_version: 4
221
+ summary: Toys template for static (public) files of a web-application
222
+ test_files: []