hookalist 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '098155040bff339fbbee0b070b3aaf896111a3a0'
4
+ data.tar.gz: 91b0f55b0366032d3e0e49121d65c44044bf8b6d
5
+ SHA512:
6
+ metadata.gz: 58465792bc78be1b5bc9b5ff5435ec7de93160fbb97b6c9da4caf1fc550d3db594835252f90087189c86bdc86e48a5571e13373944f8102be47eb52f349c59b3
7
+ data.tar.gz: ea4d3b52a60523cfb9c56aceaf68338f0fd4de84699f77cbf23eb490c26691618a91808a1a8e02f2d5c5411f36ed7f6fa667599ff4a8194aedf11ef7c59c684d
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea/
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
14
+
15
+
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.14.6
6
+
7
+
@@ -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 gore.sebyx@yahoo.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,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in hookalist.gemspec
4
+ gemspec
5
+
6
+
7
+
data/LICENSE.txt ADDED
@@ -0,0 +1,25 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 sebi
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
+
13
+
14
+
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Hookalist
2
+
3
+ Gem to ping search engines - INCOMPLETE
4
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
8
+
9
+
10
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "hookalist"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/hk ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "hookalist"
data/bin/setup ADDED
@@ -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
data/hookalist.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'hookalist/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'hookalist'
8
+ spec.version = Hookalist::VERSION
9
+ spec.authors = ['sebi']
10
+ spec.email = ['gore.sebyx@yahoo.com']
11
+
12
+ spec.summary = %q{Gem to ping search engines - INCOMPLETE}
13
+ spec.description = %q{dwadadwawdd312}
14
+ spec.homepage = 'https://github.com/sebyx07/hookalist'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.14'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'pry', '~> 0.9.12'
28
+ spec.add_dependency 'activesupport', '~> 5.0.0'
29
+ spec.add_dependency 'cli', '~> 1.3.1'
30
+ end
@@ -0,0 +1,23 @@
1
+ module Hookalist
2
+ class File
3
+ attr_reader :file_name, :start_time, :commit_time
4
+
5
+ def initialize(file_name, start_time, commit_time)
6
+ @file_name = file_name
7
+ @start_time = start_time.clone
8
+ @commit_time = commit_time.clone
9
+ end
10
+
11
+ def file_path
12
+ @file_path ||= Dir.pwd + "/#{file_name}"
13
+ end
14
+
15
+ def touch_command
16
+ c_time = rand(start_time...commit_time)
17
+ seconds = (Time.now - c_time).to_i
18
+ command = "touch -d \"#{seconds} seconds ago\" #{file_path}"
19
+ puts "#{command}"
20
+ command
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module Hookalist
2
+ VERSION = "0.1.0"
3
+ end
data/lib/hookalist.rb ADDED
@@ -0,0 +1,75 @@
1
+ require 'hookalist/version'
2
+ require 'active_support/all'
3
+ require 'cli'
4
+ require 'pry'
5
+ require 'hookalist/file'
6
+
7
+ module Hookalist
8
+ end
9
+
10
+ settings = CLI.new do
11
+ option :date, description: 'Date', default: 'today'
12
+ option :commits, description: 'Number Of Commits', cast: Integer, default: 4
13
+ option :interval, description: 'Interval'
14
+ end.parse! do |settings|
15
+ fail('Interval must be for example 10-24') unless settings.interval =~ /\d+-\d+/
16
+ settings.interval = settings.interval.split('-').map(&:to_i)
17
+
18
+ if settings.date == 'today'
19
+ settings.date = Date.today
20
+ else
21
+ settings.date = eval(settings.date)
22
+ end
23
+ settings.date = settings.date.midnight + settings.interval[0].hours
24
+
25
+ end
26
+
27
+ files = `git diff --name-only`.split("\n")
28
+ files.concat(`git ls-files --others --exclude-standard`.split("\n"))
29
+ files_groups = files.shuffle.in_groups_of((files.size / settings.commits.to_f).ceil)
30
+ if files_groups.size < settings.commits
31
+ #raise 'Too many commits'
32
+ end
33
+
34
+ max_seconds = (settings.interval[1] - settings.interval[0]) * 3600
35
+ seconds = max_seconds / settings.commits
36
+ start_seconds_range = seconds * 0.80
37
+ end_minutes_range = seconds * 1.20
38
+
39
+
40
+ start_time = settings.date
41
+ old_commit_time = nil
42
+ commit_dates = settings.commits.times.map do
43
+ seed = rand(start_seconds_range...end_minutes_range).to_i.seconds
44
+ _start_time = old_commit_time || start_time.clone
45
+ commit_time = start_time + seed
46
+ old_commit_time = commit_time
47
+ start_time += seconds
48
+ {start_time: _start_time, commit_time: commit_time}
49
+ end
50
+
51
+ commit_dates.each_with_index do |date, index|
52
+ file_group = files_groups[index]
53
+ unless file_group
54
+ break
55
+ end
56
+ file_group.compact.each do |file_name|
57
+ file = Hookalist::File.new(file_name, date[:start_time], date[:commit_time])
58
+ system file.touch_command
59
+ end
60
+
61
+ add_command = "git add #{file_group.join(' ')}"
62
+ puts add_command
63
+ system add_command
64
+
65
+ puts 'Commit message:'
66
+ message = STDIN.gets.chomp
67
+
68
+ time = date[:commit_time]
69
+ change_dates = "GIT_AUTHOR_DATE=\"#{time}\" GIT_COMMITTER_DATE=\"#{time}\""
70
+
71
+
72
+ commit_command = "git commit -m \"#{message.chomp}\" --amend --no-edit --date=\"#{time}\""
73
+ puts commit_command
74
+ system commit_command
75
+ end
data/r.txt ADDED
@@ -0,0 +1,3 @@
1
+ hk --date today --interval --commits 8 --interval 10-14
2
+ hk --date 1.day.ago --commits 10 --interval 12-15
3
+
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hookalist
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - sebi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.12
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.9.12
69
+ - !ruby/object:Gem::Dependency
70
+ name: activesupport
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 5.0.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 5.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: cli
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.3.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.3.1
97
+ description: dwadadwawdd312
98
+ email:
99
+ - gore.sebyx@yahoo.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
+ - CODE_OF_CONDUCT.md
108
+ - Gemfile
109
+ - LICENSE.txt
110
+ - README.md
111
+ - Rakefile
112
+ - bin/console
113
+ - bin/hk
114
+ - bin/setup
115
+ - hookalist.gemspec
116
+ - lib/hookalist.rb
117
+ - lib/hookalist/file.rb
118
+ - lib/hookalist/version.rb
119
+ - r.txt
120
+ homepage: https://github.com/sebyx07/hookalist
121
+ licenses:
122
+ - MIT
123
+ metadata: {}
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 2.6.10
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Gem to ping search engines - INCOMPLETE
144
+ test_files: []