trop 0.0.16 → 0.4.27

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: 7f1f43313f1f83dd23b6da38acd78df436c4f5fbd459b85a399c2ecfe676e2d9
4
- data.tar.gz: 90f5d4177919358ce49e37751a1c70c54a301634fb280d7100d1c5224d1a4b0b
3
+ metadata.gz: 75869b68687d11168656dfabd3d6f149f3891ed8dc85b0e32293263e891abf07
4
+ data.tar.gz: e7989351fb9da6f4440fe4edb0f93550d8af5a0494b21112b1a6dff7eb6d8882
5
5
  SHA512:
6
- metadata.gz: a4c7ff1eadcb309f8e70c4ad36f329c45fdf32691a1ac12749db832a7c7a06600f7d106d2639bf08d306876b6988d549c2aa8f8b875199009fb76683568ccf19
7
- data.tar.gz: edd63637a73b6c322357e9c690717e520e0567ab4877a8789d368701cdd3a1bd8a593484baf85b143a43534d3717fb4710fa6489087c342d04a3223a25b2800b
6
+ metadata.gz: 6cc4635b6de94084d2e115e1b5f4fdc0a4f4008f7ae03afdb292d29385dba200b3af643b5f3e2a2589e3f3b5b72422c47ad6501581de8e8347c6de310aa46698
7
+ data.tar.gz: 2f1fc6721badaa71c1c4dbf915568fcd5faccb7efc5c2ca91477364d8d280f91ccf103b58c4a2b435a066efb60a831b3509df370a77be6c13880bc4930d1da6c
data/Gemfile CHANGED
@@ -1,25 +1,31 @@
1
- source 'https://rubygems.org'
1
+ #source 'https://rubygems.org'
2
+ source 'http://localhost:9292/'
3
+
2
4
  # Add dependencies required to use your gem here.
3
5
  # Example:
4
- gem 'activesupport', '>= 2.3.5'
5
-
6
-
6
+ gem 'activesupport', '>= 2.3.5', require: false
7
7
 
8
8
  # Add dependencies to develop your gem here.
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
-
12
- gem 'rdoc', '~> 3.12'
11
+ gem 'minitest', '~> 5.11'
13
12
  gem 'shoulda', '~> 3.6'
14
13
  gem 'simplecov', '~> 0.16.1'
15
14
  gem 'test-unit', '~> 3.3'
16
- gem 'bundler_geminabox'
17
- end
18
-
15
+ gem 'rake', '~> 12.3'
16
+ gem "factory_bot", "~> 5.0"
17
+ gem "minitest-reporters", "~> 1.3"
18
+ gem "bump", "~> 0.8.0"
19
+ gem "gem_version", "~> 0.0.6"
19
20
 
21
+ end
20
22
 
21
- gem "rake", "~> 12.3"
22
- gem "jeweler", github: 'technicalpickles/jeweler'
23
23
 
24
+ gem 'dotenv'
24
25
  gem 'bundler', '~> 2.0.1'
26
+ gem "bundler_geminabox"
27
+
28
+ gem 'sentry-raven'
29
+ gem 'colorize'
25
30
 
31
+ gem "bundler-geminabox", "~> 1.0"
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
- # trop
1
+ [![pipeline status](https://gitlab.wfschmitt.net/harman/trop/badges/master/pipeline.svg)](https://gitlab.wfschmitt.net/harman/trop/commits/master)
2
2
 
3
- Description goes here.
3
+
4
+ [![coverage report](https://gitlab.wfschmitt.net/harman/trop/badges/master/coverage.svg)](https://gitlab.wfschmitt.net/harman/trop/commits/master)
5
+
6
+ # Description goes here.
4
7
 
5
8
  ## Contributing to trop
6
9
 
data/README.rakes.md ADDED
@@ -0,0 +1,34 @@
1
+ ## rake targets
2
+
3
+ rake | desc
4
+ :--------------- | -------------------------
5
+ `rake build ` | Build trop-0.2.9.gem into the pkg directory / Build gem into pkg/
6
+ `rake clean ` | Remove any temporary products
7
+ `rake clobber ` | Remove any generated files
8
+ `rake console[script] ` | Start IRB with all runtime dependencies loaded
9
+ `rake default ` | |
10
+ `rake deploy ` | prepare deployment in public
11
+ `rake gemcutter:release ` | Release gem to Gemcutter
12
+ `rake gemspec ` | Generate and validate gemspec
13
+ `rake gemspec:debug ` | Display the gemspec for debugging purposes, as jeweler knows it (not from the filesystem)
14
+ `rake gemspec:generate ` | Regenerate the gemspec on the filesystem
15
+ `rake gemspec:release ` | Regenerate and validate gemspec, and then commits and pushes to git
16
+ `rake gemspec:validate ` | Validates the gemspec on the filesystem
17
+ `rake gemspec_required ` | |
18
+ `rake git:release ` | Tag and push release to git
19
+ `rake install ` | Build and install trop-0.2.9.gem into system gems / Build and install gem using `gem install`
20
+ `rake install:local ` | Build and install trop-0.2.9.gem into system gems without network access
21
+ `rake next ` | |
22
+ `rake nexta ` | |
23
+ `rake release[remote] ` | Create tag v0.2.9 and build and push trop-0.2.9.gem to rubygems.org / Release gem
24
+ `rake release:guard_clean ` | |
25
+ `rake release:rubygem_push ` | |
26
+ `rake release:source_control_push[remote] ` | |
27
+ `rake simplecov ` | Code coverage detail
28
+ `rake test ` | Run tests
29
+ `rake version ` | Displays the current version
30
+ `rake version:bump:major ` | Bump the major version by 1
31
+ `rake version:bump:minor ` | Bump the a minor version by 1
32
+ `rake version:bump:patch ` | Bump the patch version by 1
33
+ `rake version:write ` | Writes out an explicit version
34
+ `rake version_required ` | |
data/Rakefile CHANGED
@@ -1,6 +1,11 @@
1
1
  require 'rubygems'
2
- require 'bundler'
3
- require "bundler_geminabox/gem_tasks"
2
+ require 'bundler/gem_tasks'
3
+ require 'bundler/endpoint_specification'
4
+ require 'rake'
5
+ require 'bump'
6
+ require 'fileutils'
7
+ require 'gem_version'
8
+
4
9
  begin
5
10
  Bundler.setup(:default, :development)
6
11
  rescue Bundler::BundlerError => e
@@ -8,30 +13,93 @@ rescue Bundler::BundlerError => e
8
13
  warn 'Run `bundle install` to install missing gems'
9
14
  exit e.status_code
10
15
  end
11
- require 'rake'
12
16
 
13
- require 'jeweler'
14
- Jeweler::Tasks.new do |gem|
17
+ desc 'Generate a gemspecx file.'
18
+ task :gemspecx do
19
+ spec_dir = File.join( FileUtils.getwd,"*.gemspec")
20
+ spec_path = Dir.glob( spec_dir ).first
21
+ spec_gem = Gem::Specification::load(spec_path)
22
+ spec_str = pp spec_gem
23
+ puts spec_str
24
+ puts spec_path
25
+ File.open("gemspecx.gemspecx", 'w') do |f|
26
+ f.write spec_gem.to_ruby
27
+ end
28
+ end
29
+
30
+ desc 'Generate a gemspec file.'
31
+ task :gemspec do
32
+ spec_dir = File.join( FileUtils.getwd,"*.gemspec")
33
+ spec_path = Dir.glob( spec_dir ).first
34
+ spec_gem = Gem::Specification::load(spec_path) do |s|
35
+ s.version = Trop::VERSION
36
+ end
37
+ File.open(spec_path, 'w') do |f|
38
+ f.write spec_gem.to_ruby
39
+ end
40
+ GemVersion.increment_version
41
+ GemVersion.commit_and_push
42
+ GemVersion.next_version
43
+ end
44
+
45
+ task :patch do
46
+ system 'bump patch --replace-in trop.gemspec --replace-in ./lib/trop/version.rb --replace-in next_gem_version'
47
+ end
48
+ task :min do
49
+ system 'bump minor --replace-in trop.gemspec --replace-in ./lib/trop/version.rb --replace-in next_gem_version'
50
+ end
51
+
52
+ task gembox: :build do
53
+ Dir.chdir('./pkg') do
54
+ system 'gem inabox *.gem --host=http://localhost:9292 -o '
55
+ end
56
+ end
57
+ #Jeweler::Tasks.new do |gem|
15
58
  # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
16
- gem.name = 'trop'
17
- gem.homepage = 'http://gitlab.wfschmitt.net/rails/trop'
18
- gem.license = 'MIT'
19
- gem.summary = %(trop is troppuS)
20
- gem.description = %(trop is support)
21
- gem.email = 'wfschmittx@gmail.com'
22
- gem.authors = ['werner']
23
- gem.files = %w[LICENSE.txt README.rdoc Gemfile Rakefile VERSION lib/trop.rb lib/trop/version.rb]
24
- # dependencies defined in Gemfile
25
- end
26
- Jeweler::RubygemsDotOrgTasks.new
59
+ # gem.name = 'trop'
60
+ # gem.homepage = 'http://gitlab.wfschmitt.net/rails/trop'
61
+ # gem.license = 'MIT'
62
+ # gem.summary = %(trop is troppuS)
63
+ # gem.description = %(trop is support)
64
+ # gem.email = 'wfschmittx@gmail.com'
65
+ # gem.authors = ['werner'gcaa
66
+ # gem.files = %w[LICENSE.txt README.md README.rakes.md Gemfile Rakefile TODO.md VERSION lib/trop/config.bundler.tpl lib/trop/core-ext.rb lib/trop/file_finder.rb lib/trop/filefind.rb lib/trop/infogit.rb lib/trop/os.rb lib/trop/shell_deb_verb.rb lib/trop/version.rb]
67
+ #end
68
+ #$SAFE = 0
69
+ #Jeweler::RubygemsDotOrgTasks.new
70
+
27
71
 
28
72
  require 'rake/testtask'
29
73
  Rake::TestTask.new(:test) do |test|
30
74
  test.libs << 'lib' << 'test'
31
- test.pattern = 'test/**/test_*.rb'
75
+ test.pattern = 'test/*_test.rb'
32
76
  test.verbose = true
33
77
  end
34
78
 
79
+ task :nexta do
80
+ puts 'hallo nexta'
81
+ puts `rake patch`
82
+ puts `rake gemspec`
83
+ puts `git add --all`
84
+ puts `git commit -m"save" --all`
85
+ puts `git save`
86
+ puts `git push`
87
+ # puts `git commit -m"save"`
88
+ end
89
+
90
+ task next: %i[test build] do
91
+ Rake::Task['nexta'].execute
92
+ Rake::Task['build'].execute
93
+ Rake::Task['install'].execute
94
+ puts `gem inabox`
95
+ end
96
+
97
+ desc 'prepare deployment in public'
98
+ task :deploy do
99
+ `mkdir -p ./public`
100
+ FileUtils.cp(%w[LICENSE.txt README.md README.rakes.md TODO.md], 'public', verbose: true)
101
+ end
102
+
35
103
  desc 'Code coverage detail'
36
104
  task :simplecov do
37
105
  ENV['COVERAGE'] = 'true'
@@ -39,18 +107,3 @@ task :simplecov do
39
107
  end
40
108
 
41
109
  task default: :test
42
-
43
- task :next do
44
- Rake::Task['version:bump:patch'].invoke
45
- Rake::Task['gemspec'].invoke
46
- Rake::Task[:clobber].invoke
47
- `git save`
48
- Rake::Task[:build].invoke
49
- Rake::Task['release'].invoke
50
-
51
- end
52
-
53
- task :release do
54
- `gem save`
55
- `gem push origin master`
56
- end
data/{TODO → TODO.md} RENAMED
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.16
1
+ 0.4.33
data/bin/setup ADDED
@@ -0,0 +1,48 @@
1
+ #!/bin/bash
2
+
3
+ IFS=$'\n\t'
4
+
5
+ if [[ -f .envrc.example ]] && ! [[ -f .envrc ]]; then
6
+ cp -v .envrc.example .envrc
7
+ fi
8
+
9
+ if [[ -f .envrc.local.example ]] && ! [[ -f .envrc.local ]]; then
10
+ cp -v .envrc.local.example .envrc.local
11
+ fi
12
+
13
+ touch .envrc .envrc.local
14
+ # Do any other automated setup that you need to do here
15
+
16
+ echo "setup ok"
17
+
18
+ [[ -f "/etc/profile.d/rvm.sh" ]] && . /etc/profile.d/rvm.sh
19
+ if [[ ! -f ".rvmrc" ]]; then
20
+ rvm rvmrc create
21
+ rvm rvmrc trust .
22
+ fi
23
+
24
+ puts '== Installing dependencies =='
25
+
26
+ system! 'cd ./pkg && gem inabox *.gem -o && cd ..'
27
+
28
+ system! 'bundle config --delete bin'
29
+ #system! 'rails app:update::bin'
30
+ #system! 'git add bin'
31
+ system! 'gem install bundler --conservative'
32
+ system 'bundle check' || system! 'bundle install'
33
+
34
+ #puts "\n== Updating database =="
35
+ #system! 'bin/rails db:migrate'
36
+ #puts "\n== Removing old logs and tempfiles =="
37
+ #system! 'bin/rails log:clear tmp:clear'
38
+ #puts "\n== Restarting application server =="
39
+ #system! 'bin/rails restart'
40
+
41
+ . .rvmrc
42
+
43
+ rvm gemset use trop --create
44
+
45
+ gem install bundler
46
+ gem install -g
47
+
48
+ bundle install
data/bin/update ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+
19
+ system! 'cd ./pkg && gem inabox *.gem -o && cd ..'
20
+
21
+ system! 'bundle config --delete bin'
22
+ #system! 'rails app:update::bin'
23
+ #system! 'git add bin'
24
+ system! 'gem install bundler --conservative'
25
+ system('bundle check') || system!('bundle install')
26
+
27
+ #puts "\n== Updating database =="
28
+ #system! 'bin/rails db:migrate'
29
+ #puts "\n== Removing old logs and tempfiles =="
30
+ #system! 'bin/rails log:clear tmp:clear'
31
+ #puts "\n== Restarting application server =="
32
+ #system! 'bin/rails restart'
33
+
34
+
35
+
36
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_PATH: "/home/werner/.rvm/gems/ruby-2.6.1"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: false
2
+
3
+ require 'active_support/core_ext/object/blank'
4
+ require 'active_support/core_ext/string/strip'
5
+ require 'active_support/core_ext/object/try'
6
+ require 'active_support/core_ext/string/inquiry'
7
+ require 'rake'
8
+ require 'rake/file_utils_ext'
@@ -0,0 +1,153 @@
1
+ # frozen_string_literal: false
2
+
3
+ require_relative 'shell_deb_verb'
4
+ require_relative 'filefind'
5
+ require 'pathname'
6
+ require 'rubygems'
7
+ require 'tempfile'
8
+ require 'colorize'
9
+
10
+ module Trop
11
+ class FileFinder
12
+
13
+ def initialize
14
+ end
15
+
16
+ def fffind(_path)
17
+ _path = Dir.getwd.to_s if _path.equal?('.')
18
+ _path = File.expand_path(_path)
19
+ @path = _path
20
+ rule = FileFind.new(
21
+ :ftype => 'file',
22
+ :follow => true,
23
+ :path => _path.to_s
24
+
25
+ )
26
+ tree = rule.find
27
+ tree
28
+ end
29
+
30
+ def dffind(_path)
31
+ _path = Dir.getwd.to_s if _path.equal?('.')
32
+ _path = File.expand_path(_path)
33
+ @path = _path
34
+ rule = FileFind.new(
35
+ :ftype => 'directory',
36
+ :follow => true,
37
+ :path => _path.to_s
38
+
39
+ )
40
+ tree = rule.find
41
+ tree
42
+ end
43
+
44
+ def filter_pages(pages)
45
+ tops = []
46
+ generics = []
47
+ contents = []
48
+ pages.each do |p|
49
+ if p.start_with?(File.join(@path, 'doc/README.md'))
50
+ tops << p
51
+ elsif p.start_with?(File.join(@path, 'generic/doc/README.md'))
52
+ tops << p
53
+ elsif p.start_with?(File.join(@path, 'doc/'))
54
+ tops << p
55
+ elsif p.start_with?(File.join(@path, 'generic/'))
56
+ generics << p
57
+ else
58
+ contents << p
59
+ end
60
+ end
61
+ return tops, generics, contents
62
+ end
63
+
64
+ def collect_dir_tree(spath)
65
+ @dirs = []
66
+
67
+ files = dffind(spath)
68
+ return files
69
+ end
70
+
71
+ # @param spath to search in
72
+ def collect_sorted_readme(spath)
73
+ @readmes = []
74
+
75
+ files = fffind(spath)
76
+ files.each do |page|
77
+ page = Pathname.new(page)
78
+ next if page.directory?
79
+ fbase = page.basename.to_s.upcase
80
+ if page.file? && fbase.include?('README') ##&& fbase.include?('.MD')
81
+ puts "Found : #{page.to_path}".red if Sh.verbose?
82
+ @readmes << page.to_s
83
+ else
84
+ Sh.info "skip: #{page.to_path}".blue if $DEBUG
85
+ end
86
+ end
87
+ @readmes = @readmes.sort
88
+ @readmes = @readmes.uniq
89
+ res1, res2, res3 = filter_pages(@readmes)
90
+ return res1, res2, res3
91
+ end
92
+
93
+ def collect_readme_md_tree(spath)
94
+ @readmes = []
95
+
96
+ files = fffind(spath)
97
+ files.each do |page|
98
+ page = Pathname.new(page)
99
+ next if page.directory?
100
+ fbase = page.basename.to_s.upcase
101
+ if page.file? && fbase.include?('README') && fbase.include?('.MD')
102
+ puts "Found : #{page.to_path}".cyan if $DEBUG
103
+ @readmes << page.to_s
104
+ else
105
+ Sh.info "skip: #{page.to_path}".blue if $DEBUG
106
+ end
107
+ end
108
+ @readmes
109
+ end
110
+
111
+ def collect_md_tree(spath)
112
+ @mds = []
113
+
114
+ files = fffind(spath)
115
+ files.each do |page|
116
+ page = Pathname.new(page)
117
+ next if page.directory?
118
+ fbase = page.basename.to_s.upcase
119
+ if page.file? && fbase.include?('.MD')
120
+ puts "Found : #{page.to_path}".cyan if $DEBUG
121
+ @mds << page.to_s
122
+ else
123
+ Sh.info "skip: #{page.to_path}".blue if $DEBUG
124
+ end
125
+ end
126
+ @mds
127
+ end
128
+
129
+ end
130
+ end
131
+
132
+ module Trop
133
+ class FileFinder
134
+
135
+ def self.collect_sorted_readme(path)
136
+ finder = FileFinder.new
137
+ finder.collect_sorted_readme(File.expand_path(path))
138
+ end
139
+
140
+ def self.collect_md_tree(path)
141
+ finder = FileFinder.new
142
+ finder.collect_md_tree(path)
143
+ end
144
+
145
+ def self.collect_dir_tree(path)
146
+ finder = FileFinder.new
147
+ finder.collect_dir_tree(path)
148
+ end
149
+
150
+ end
151
+ end
152
+
153
+