at_coder_friends 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +27 -0
- data/.rubocop_todo.yml +8 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +83 -0
- data/LICENSE.txt +21 -0
- data/README.md +114 -0
- data/Rakefile +8 -0
- data/at_coder_friends.gemspec +38 -0
- data/bin/console +15 -0
- data/bin/setup +10 -0
- data/config/.at_coder_friends.yml.sample +2 -0
- data/exe/at_coder_friends +8 -0
- data/lib/at_coder_friends.rb +17 -0
- data/lib/at_coder_friends/cli.rb +122 -0
- data/lib/at_coder_friends/config_loader.rb +35 -0
- data/lib/at_coder_friends/cxx_generator.rb +179 -0
- data/lib/at_coder_friends/emitter.rb +43 -0
- data/lib/at_coder_friends/errors.rb +7 -0
- data/lib/at_coder_friends/format_parser.rb +148 -0
- data/lib/at_coder_friends/judge_test_runner.rb +34 -0
- data/lib/at_coder_friends/path_util.rb +33 -0
- data/lib/at_coder_friends/problem.rb +48 -0
- data/lib/at_coder_friends/ruby_generator.rb +97 -0
- data/lib/at_coder_friends/sample_test_runner.rb +31 -0
- data/lib/at_coder_friends/scraping_agent.rb +135 -0
- data/lib/at_coder_friends/test_runner.rb +82 -0
- data/lib/at_coder_friends/verifier.rb +33 -0
- data/lib/at_coder_friends/version.rb +5 -0
- metadata +166 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
module AtCoderFriends
|
6
|
+
# marks and checks if the source has been verified.
|
7
|
+
class Verifier
|
8
|
+
attr_reader :path, :file, :vdir, :vpath
|
9
|
+
def initialize(path)
|
10
|
+
@path = File.expand_path(path)
|
11
|
+
@file = File.basename(@path)
|
12
|
+
@vdir = File.join(File.dirname(@path), '.tmp')
|
13
|
+
@vpath = File.join(@vdir, "#{@file}.verified")
|
14
|
+
end
|
15
|
+
|
16
|
+
def verify
|
17
|
+
return unless File.exist?(path)
|
18
|
+
FileUtils.makedirs(vdir) unless Dir.exist?(vdir)
|
19
|
+
FileUtils.touch(vpath)
|
20
|
+
end
|
21
|
+
|
22
|
+
def unverify
|
23
|
+
return unless File.exist?(vpath)
|
24
|
+
File.delete(vpath)
|
25
|
+
end
|
26
|
+
|
27
|
+
def verified?
|
28
|
+
return false unless File.exist?(vpath)
|
29
|
+
return false if File.mtime(vpath) < File.mtime(path)
|
30
|
+
true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: at_coder_friends
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- nejiko96
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mechanize
|
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: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.10'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webmock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
description: |2
|
98
|
+
AtCoder support tool
|
99
|
+
- generate source template
|
100
|
+
- generate test data from sample input/output
|
101
|
+
- run tests
|
102
|
+
- submit code
|
103
|
+
email:
|
104
|
+
- nejiko2006@gmail.com
|
105
|
+
executables:
|
106
|
+
- at_coder_friends
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files: []
|
109
|
+
files:
|
110
|
+
- ".gitignore"
|
111
|
+
- ".rspec"
|
112
|
+
- ".rubocop.yml"
|
113
|
+
- ".rubocop_todo.yml"
|
114
|
+
- ".travis.yml"
|
115
|
+
- CODE_OF_CONDUCT.md
|
116
|
+
- Gemfile
|
117
|
+
- Gemfile.lock
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.md
|
120
|
+
- Rakefile
|
121
|
+
- at_coder_friends.gemspec
|
122
|
+
- bin/console
|
123
|
+
- bin/setup
|
124
|
+
- config/.at_coder_friends.yml.sample
|
125
|
+
- exe/at_coder_friends
|
126
|
+
- lib/at_coder_friends.rb
|
127
|
+
- lib/at_coder_friends/cli.rb
|
128
|
+
- lib/at_coder_friends/config_loader.rb
|
129
|
+
- lib/at_coder_friends/cxx_generator.rb
|
130
|
+
- lib/at_coder_friends/emitter.rb
|
131
|
+
- lib/at_coder_friends/errors.rb
|
132
|
+
- lib/at_coder_friends/format_parser.rb
|
133
|
+
- lib/at_coder_friends/judge_test_runner.rb
|
134
|
+
- lib/at_coder_friends/path_util.rb
|
135
|
+
- lib/at_coder_friends/problem.rb
|
136
|
+
- lib/at_coder_friends/ruby_generator.rb
|
137
|
+
- lib/at_coder_friends/sample_test_runner.rb
|
138
|
+
- lib/at_coder_friends/scraping_agent.rb
|
139
|
+
- lib/at_coder_friends/test_runner.rb
|
140
|
+
- lib/at_coder_friends/verifier.rb
|
141
|
+
- lib/at_coder_friends/version.rb
|
142
|
+
homepage: https://github.com/nejiko96/at_coder_friends
|
143
|
+
licenses:
|
144
|
+
- MIT
|
145
|
+
metadata: {}
|
146
|
+
post_install_message:
|
147
|
+
rdoc_options: []
|
148
|
+
require_paths:
|
149
|
+
- lib
|
150
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.7.5
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: AtCoder support tool
|
166
|
+
test_files: []
|