web_stat 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +84 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +8 -0
- data/lib/web_stat/categorize.rb +5 -0
- data/lib/web_stat/config/web_stat.yml +13 -0
- data/lib/web_stat/configure.rb +30 -0
- data/lib/web_stat/errors.rb +3 -0
- data/lib/web_stat/fetch/fetch_as_html.rb +11 -0
- data/lib/web_stat/fetch/fetch_as_web.rb +23 -0
- data/lib/web_stat/fetch.rb +92 -0
- data/lib/web_stat/tag.rb +22 -0
- data/lib/web_stat/tasks/install.rake +13 -0
- data/lib/web_stat/version.rb +3 -0
- data/lib/web_stat.rb +20 -0
- data/spec/fixtures/htmls/blog.html +190 -0
- data/spec/fixtures/htmls/h1-title.html +11 -0
- data/spec/fixtures/htmls/image.html +191 -0
- data/spec/spec_helper.rb +53 -0
- data/spec/web_stat/configure_spec.rb +13 -0
- data/spec/web_stat/fetch_spec.rb +69 -0
- data/spec/web_stat/tag_spec.rb +14 -0
- data/spec/web_stat_spec.rb +2 -0
- data/web_stat.gemspec +33 -0
- metadata +207 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
|
|
7
|
+
<title>gem作成でついまずいたところ - newsdict.blog</title>
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
|
+
|
|
10
|
+
<link href="https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,600,600i%7CKarla:400,400i,700,700i" rel="stylesheet">
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="/assets/css/style.css?v=94e094a36d" />
|
|
12
|
+
|
|
13
|
+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
|
14
|
+
<link rel="canonical" href="https://newsdict.blog/gem-issues/" />
|
|
15
|
+
<meta name="referrer" content="no-referrer-when-downgrade" />
|
|
16
|
+
<link rel="amphtml" href="https://newsdict.blog/gem-issues/amp/" />
|
|
17
|
+
|
|
18
|
+
<meta property="og:site_name" content="newsdict.blog" />
|
|
19
|
+
<meta property="og:type" content="article" />
|
|
20
|
+
<meta property="og:title" content="gem作成でついまずいたところ" />
|
|
21
|
+
<meta property="og:description" content="・gitにcommit してないものは、gem build *.gemspec, rake
|
|
22
|
+
buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。" />
|
|
23
|
+
<meta property="og:url" content="https://newsdict.blog/gem-issues/" />
|
|
24
|
+
<meta property="article:published_time" content="2019-03-20T11:17:30.000Z" />
|
|
25
|
+
<meta property="article:modified_time" content="2019-03-21T09:57:30.000Z" />
|
|
26
|
+
<meta property="article:tag" content="rubygems" />
|
|
27
|
+
|
|
28
|
+
<meta property="article:publisher" content="https://www.facebook.com/newsdict" />
|
|
29
|
+
<meta name="twitter:card" content="summary" />
|
|
30
|
+
<meta name="twitter:title" content="gem作成でついまずいたところ" />
|
|
31
|
+
<meta name="twitter:description" content="・gitにcommit してないものは、gem build *.gemspec, rake
|
|
32
|
+
buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。" />
|
|
33
|
+
<meta name="twitter:url" content="https://newsdict.blog/gem-issues/" />
|
|
34
|
+
<meta name="twitter:label1" content="Written by" />
|
|
35
|
+
<meta name="twitter:data1" content="Yusuke Abe" />
|
|
36
|
+
<meta name="twitter:label2" content="Filed under" />
|
|
37
|
+
<meta name="twitter:data2" content="rubygems" />
|
|
38
|
+
<meta name="twitter:site" content="@newsdict" />
|
|
39
|
+
|
|
40
|
+
<script type="application/ld+json">
|
|
41
|
+
{
|
|
42
|
+
"@context": "https://schema.org",
|
|
43
|
+
"@type": "Article",
|
|
44
|
+
"publisher": {
|
|
45
|
+
"@type": "Organization",
|
|
46
|
+
"name": "newsdict.blog",
|
|
47
|
+
"logo": {
|
|
48
|
+
"@type": "ImageObject",
|
|
49
|
+
"url": "https://newsdict.blog/favicon.ico",
|
|
50
|
+
"width": 60,
|
|
51
|
+
"height": 60
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"author": {
|
|
55
|
+
"@type": "Person",
|
|
56
|
+
"name": "Yusuke Abe",
|
|
57
|
+
"image": {
|
|
58
|
+
"@type": "ImageObject",
|
|
59
|
+
"url": "https://newsdict.blog/content/images/2019/03/facebook-3.jpg",
|
|
60
|
+
"width": 1200,
|
|
61
|
+
"height": 1208
|
|
62
|
+
},
|
|
63
|
+
"url": "https://newsdict.blog/author/yusuke/",
|
|
64
|
+
"sameAs": []
|
|
65
|
+
},
|
|
66
|
+
"headline": "gem作成でついまずいたところ",
|
|
67
|
+
"url": "https://newsdict.blog/gem-issues/",
|
|
68
|
+
"datePublished": "2019-03-20T11:17:30.000Z",
|
|
69
|
+
"dateModified": "2019-03-21T09:57:30.000Z",
|
|
70
|
+
"keywords": "rubygems",
|
|
71
|
+
"description": "・gitにcommit してないものは、gem build *.gemspec, rake\nbuildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。",
|
|
72
|
+
"mainEntityOfPage": {
|
|
73
|
+
"@type": "WebPage",
|
|
74
|
+
"@id": "https://newsdict.blog/"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<meta name="generator" content="Ghost 2.18" />
|
|
80
|
+
<link rel="alternate" type="application/rss+xml" title="newsdict.blog" href="https://newsdict.blog/rss/" />
|
|
81
|
+
</head>
|
|
82
|
+
<body class="post-template tag-rubygems">
|
|
83
|
+
|
|
84
|
+
<div id="page" class="site">
|
|
85
|
+
<header id="masthead" class="site-header">
|
|
86
|
+
<div class="site-header-wrap">
|
|
87
|
+
<div class="site-header-inside">
|
|
88
|
+
|
|
89
|
+
<div class="site-branding">
|
|
90
|
+
<p class="profile"><a href="https://newsdict.blog">
|
|
91
|
+
<img srcset="/content/images/size/w100/2019/03/facebook-3.jpg 100w, /content/images/size/w300/2019/03/facebook-3.jpg 300w" sizes="(max-width: 800px) 45px, 100px" src="/content/images/size/w100/2019/03/facebook-3.jpg" alt="Yusuke Abe" class="avatar" /></a></p>
|
|
92
|
+
<div class="site-identity">
|
|
93
|
+
<p class="site-title"><a href="https://newsdict.blog">newsdict.blog</a></p>
|
|
94
|
+
<p class="site-description">Thoughts, stories and ideas.</p>
|
|
95
|
+
</div><!-- .site-identity -->
|
|
96
|
+
<button id="menu-toggle" class="menu-toggle"><span class="screen-reader-text">Menu</span><span class="icon-menu" aria-hidden="true"></span></button>
|
|
97
|
+
</div><!-- .site-branding -->
|
|
98
|
+
|
|
99
|
+
<nav id="main-navigation" class="site-navigation" aria-label="Main Navigation">
|
|
100
|
+
<div class="site-nav-wrap">
|
|
101
|
+
<div class="site-nav-inside">
|
|
102
|
+
<ul class="menu">
|
|
103
|
+
<li class="menu-item menu-item-home"><a href="https://newsdict.blog/">Home</a></li>
|
|
104
|
+
<li class="menu-item menu-item-tag"><a href="https://newsdict.blog/tag/getting-started/">Tag</a></li>
|
|
105
|
+
<li class="menu-item menu-item-favorite-posts"><a href="http://newsdict.jp/">Favorite Posts</a></li>
|
|
106
|
+
<li class="menu-item menu-item-contact-me"><a href="https://newsdict.jp/contact/">Contact me</a></li>
|
|
107
|
+
</ul><!-- .menu -->
|
|
108
|
+
|
|
109
|
+
<div class="social-links">
|
|
110
|
+
<a href="https://www.facebook.com/newsdict" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 56.7v398.5c0 13.7-11.1 24.7-24.7 24.7H309.1V306.5h58.2l8.7-67.6h-67v-43.2c0-19.6 5.4-32.9 33.5-32.9h35.8v-60.5c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87 89.4v49.9h-58.4v67.6h58.4V480H24.7C11.1 480 0 468.9 0 455.3V56.7C0 43.1 11.1 32 24.7 32h398.5c13.7 0 24.8 11.1 24.8 24.7z"/></svg>
|
|
111
|
+
<!--
|
|
112
|
+
Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
|
|
113
|
+
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
114
|
+
--></a>
|
|
115
|
+
<a href="https://twitter.com/newsdict" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
|
|
116
|
+
<!--
|
|
117
|
+
Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
|
|
118
|
+
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
119
|
+
--></a>
|
|
120
|
+
</div><!-- .social-links -->
|
|
121
|
+
</div><!-- .site-nav-inside -->
|
|
122
|
+
</div><!-- .site-nav-wrap -->
|
|
123
|
+
</nav><!-- .site-navigation -->
|
|
124
|
+
|
|
125
|
+
</div><!-- .site-header-inside -->
|
|
126
|
+
</div><!-- .site-header-wrap -->
|
|
127
|
+
</header><!-- .site-header -->
|
|
128
|
+
<div id="content" class="site-content">
|
|
129
|
+
<div class="inner-wide">
|
|
130
|
+
|
|
131
|
+
<main id="main" class="site-main">
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
<article class="post tag-rubygems post-full inner">
|
|
135
|
+
|
|
136
|
+
<header class="post-header">
|
|
137
|
+
<div class="post-meta">
|
|
138
|
+
<time class="published" datetime="2019-03-20">March 20, 2019</time>
|
|
139
|
+
</div><!-- .post-meta -->
|
|
140
|
+
<h1 class="post-title">gem作成でついまずいたところ</h1>
|
|
141
|
+
<div class="post-tags"><a href="/tag/rubygems/">rubygems</a></div>
|
|
142
|
+
</header><!-- .post-header -->
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<div class="post-content">
|
|
146
|
+
<p>・gitにcommit してないものは、gem build *.gemspec, rake buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。</p>
|
|
147
|
+
</div><!-- .post-content -->
|
|
148
|
+
|
|
149
|
+
<footer class="post-footer">
|
|
150
|
+
<p class="post-share">
|
|
151
|
+
<span class="post-share-title">Share:</span>
|
|
152
|
+
<a target="_blank" href="https://twitter.com/intent/tweet?text=gem%E4%BD%9C%E6%88%90%E3%81%A7%E3%81%A4%E3%81%84%E3%81%BE%E3%81%9A%E3%81%84%E3%81%9F%E3%81%A8%E3%81%93%E3%82%8D&url=https://newsdict.blog/gem-issues/" rel="noopener">Twitter</a>
|
|
153
|
+
<a target="_blank" href="https://www.facebook.com/sharer.php?u=https://newsdict.blog/gem-issues/" rel="noopener">Facebook</a>
|
|
154
|
+
<a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=https://newsdict.blog/gem-issues/&title=gem%E4%BD%9C%E6%88%90%E3%81%A7%E3%81%A4%E3%81%84%E3%81%BE%E3%81%9A%E3%81%84%E3%81%9F%E3%81%A8%E3%81%93%E3%82%8D&source=newsdict.blog" rel="noopener">LinkedIn</a>
|
|
155
|
+
</p>
|
|
156
|
+
</footer><!-- .post-footer -->
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
</article><!-- .post -->
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
<section class="tagcloud inner">
|
|
164
|
+
<h2 class="tagcloud-title">Tags</h2>
|
|
165
|
+
<div class="tag-links">
|
|
166
|
+
<a href="/tag/getting-started/">Getting Started (1)</a>
|
|
167
|
+
<a href="/tag/rubygems/">rubygems (1)</a>
|
|
168
|
+
</div><!-- .tag-links -->
|
|
169
|
+
</section><!-- .tagcloud -->
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</main><!-- .site-main -->
|
|
173
|
+
|
|
174
|
+
<footer id="colophon" class="site-footer">
|
|
175
|
+
<p class="site-info inner"><a href="https://newsdict.blog">newsdict.blog</a> © 2019. Royce theme by <a target="_blank" href="https://justgoodthemes.com/" rel="noopener">Just Good Themes</a>. Powered by <a target="_blank" href="https://ghost.org" rel="noopener">Ghost</a>.</p>
|
|
176
|
+
<a id="back-to-top" class="back-to-top" href="#page"><span class="icon-arrow-up" aria-hidden="true"></span><span class="screen-reader-text">Back to top</span></a>
|
|
177
|
+
</footer><!-- .site-footer -->
|
|
178
|
+
</div><!-- .inner-wide -->
|
|
179
|
+
</div><!-- .site-content -->
|
|
180
|
+
</div><!-- .site -->
|
|
181
|
+
|
|
182
|
+
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
|
183
|
+
<script>window.jQuery || document.write('<script src="/assets/js/jquery-3.3.1.min.js?v=94e094a36d"><\/script>');</script>
|
|
184
|
+
<script src="/assets/js/plugins.js?v=94e094a36d"></script>
|
|
185
|
+
<script src="/assets/js/custom.js?v=94e094a36d"></script>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</body>
|
|
190
|
+
</html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>h1 - newsdict.blog</title>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
</head>
|
|
8
|
+
<body class="post-template tag-rubygems">
|
|
9
|
+
<h1 class="post-title">gem作成でついまずいたところ</h1>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
|
|
7
|
+
<title>gem作成でついまずいたところ - newsdict.blog</title>
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
|
+
|
|
10
|
+
<link href="https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,600,600i%7CKarla:400,400i,700,700i" rel="stylesheet">
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="/assets/css/style.css?v=94e094a36d" />
|
|
12
|
+
|
|
13
|
+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
|
14
|
+
<link rel="canonical" href="https://newsdict.blog/gem-issues/" />
|
|
15
|
+
<meta name="referrer" content="no-referrer-when-downgrade" />
|
|
16
|
+
<link rel="amphtml" href="https://newsdict.blog/gem-issues/amp/" />
|
|
17
|
+
|
|
18
|
+
<meta property="og:image" content="https://cdn.newsdict.jp/assets/newsdict-5d8601394c3f4eea2d7161ab92ab327ac7099e22214c853327011b3a71859b8e.png" />
|
|
19
|
+
<meta property="og:site_name" content="newsdict.blog" />
|
|
20
|
+
<meta property="og:type" content="article" />
|
|
21
|
+
<meta property="og:title" content="gem作成でついまずいたところ" />
|
|
22
|
+
<meta property="og:description" content="・gitにcommit してないものは、gem build *.gemspec, rake
|
|
23
|
+
buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。" />
|
|
24
|
+
<meta property="og:url" content="https://newsdict.blog/gem-issues/" />
|
|
25
|
+
<meta property="article:published_time" content="2019-03-20T11:17:30.000Z" />
|
|
26
|
+
<meta property="article:modified_time" content="2019-03-21T09:57:30.000Z" />
|
|
27
|
+
<meta property="article:tag" content="rubygems" />
|
|
28
|
+
|
|
29
|
+
<meta property="article:publisher" content="https://www.facebook.com/newsdict" />
|
|
30
|
+
<meta name="twitter:card" content="summary" />
|
|
31
|
+
<meta name="twitter:title" content="gem作成でついまずいたところ" />
|
|
32
|
+
<meta name="twitter:description" content="・gitにcommit してないものは、gem build *.gemspec, rake
|
|
33
|
+
buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。" />
|
|
34
|
+
<meta name="twitter:url" content="https://newsdict.blog/gem-issues/" />
|
|
35
|
+
<meta name="twitter:label1" content="Written by" />
|
|
36
|
+
<meta name="twitter:data1" content="Yusuke Abe" />
|
|
37
|
+
<meta name="twitter:label2" content="Filed under" />
|
|
38
|
+
<meta name="twitter:data2" content="rubygems" />
|
|
39
|
+
<meta name="twitter:site" content="@newsdict" />
|
|
40
|
+
|
|
41
|
+
<script type="application/ld+json">
|
|
42
|
+
{
|
|
43
|
+
"@context": "https://schema.org",
|
|
44
|
+
"@type": "Article",
|
|
45
|
+
"publisher": {
|
|
46
|
+
"@type": "Organization",
|
|
47
|
+
"name": "newsdict.blog",
|
|
48
|
+
"logo": {
|
|
49
|
+
"@type": "ImageObject",
|
|
50
|
+
"url": "https://newsdict.blog/favicon.ico",
|
|
51
|
+
"width": 60,
|
|
52
|
+
"height": 60
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"author": {
|
|
56
|
+
"@type": "Person",
|
|
57
|
+
"name": "Yusuke Abe",
|
|
58
|
+
"image": {
|
|
59
|
+
"@type": "ImageObject",
|
|
60
|
+
"url": "https://newsdict.blog/content/images/2019/03/facebook-3.jpg",
|
|
61
|
+
"width": 1200,
|
|
62
|
+
"height": 1208
|
|
63
|
+
},
|
|
64
|
+
"url": "https://newsdict.blog/author/yusuke/",
|
|
65
|
+
"sameAs": []
|
|
66
|
+
},
|
|
67
|
+
"headline": "gem作成でついまずいたところ",
|
|
68
|
+
"url": "https://newsdict.blog/gem-issues/",
|
|
69
|
+
"datePublished": "2019-03-20T11:17:30.000Z",
|
|
70
|
+
"dateModified": "2019-03-21T09:57:30.000Z",
|
|
71
|
+
"keywords": "rubygems",
|
|
72
|
+
"description": "・gitにcommit してないものは、gem build *.gemspec, rake\nbuildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。",
|
|
73
|
+
"mainEntityOfPage": {
|
|
74
|
+
"@type": "WebPage",
|
|
75
|
+
"@id": "https://newsdict.blog/"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<meta name="generator" content="Ghost 2.18" />
|
|
81
|
+
<link rel="alternate" type="application/rss+xml" title="newsdict.blog" href="https://newsdict.blog/rss/" />
|
|
82
|
+
</head>
|
|
83
|
+
<body class="post-template tag-rubygems">
|
|
84
|
+
|
|
85
|
+
<div id="page" class="site">
|
|
86
|
+
<header id="masthead" class="site-header">
|
|
87
|
+
<div class="site-header-wrap">
|
|
88
|
+
<div class="site-header-inside">
|
|
89
|
+
|
|
90
|
+
<div class="site-branding">
|
|
91
|
+
<p class="profile"><a href="https://newsdict.blog">
|
|
92
|
+
<img srcset="/content/images/size/w100/2019/03/facebook-3.jpg 100w, /content/images/size/w300/2019/03/facebook-3.jpg 300w" sizes="(max-width: 800px) 45px, 100px" src="/content/images/size/w100/2019/03/facebook-3.jpg" alt="Yusuke Abe" class="avatar" /></a></p>
|
|
93
|
+
<div class="site-identity">
|
|
94
|
+
<p class="site-title"><a href="https://newsdict.blog">newsdict.blog</a></p>
|
|
95
|
+
<p class="site-description">Thoughts, stories and ideas.</p>
|
|
96
|
+
</div><!-- .site-identity -->
|
|
97
|
+
<button id="menu-toggle" class="menu-toggle"><span class="screen-reader-text">Menu</span><span class="icon-menu" aria-hidden="true"></span></button>
|
|
98
|
+
</div><!-- .site-branding -->
|
|
99
|
+
|
|
100
|
+
<nav id="main-navigation" class="site-navigation" aria-label="Main Navigation">
|
|
101
|
+
<div class="site-nav-wrap">
|
|
102
|
+
<div class="site-nav-inside">
|
|
103
|
+
<ul class="menu">
|
|
104
|
+
<li class="menu-item menu-item-home"><a href="https://newsdict.blog/">Home</a></li>
|
|
105
|
+
<li class="menu-item menu-item-tag"><a href="https://newsdict.blog/tag/getting-started/">Tag</a></li>
|
|
106
|
+
<li class="menu-item menu-item-favorite-posts"><a href="http://newsdict.jp/">Favorite Posts</a></li>
|
|
107
|
+
<li class="menu-item menu-item-contact-me"><a href="https://newsdict.jp/contact/">Contact me</a></li>
|
|
108
|
+
</ul><!-- .menu -->
|
|
109
|
+
|
|
110
|
+
<div class="social-links">
|
|
111
|
+
<a href="https://www.facebook.com/newsdict" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 56.7v398.5c0 13.7-11.1 24.7-24.7 24.7H309.1V306.5h58.2l8.7-67.6h-67v-43.2c0-19.6 5.4-32.9 33.5-32.9h35.8v-60.5c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87 89.4v49.9h-58.4v67.6h58.4V480H24.7C11.1 480 0 468.9 0 455.3V56.7C0 43.1 11.1 32 24.7 32h398.5c13.7 0 24.8 11.1 24.8 24.7z"/></svg>
|
|
112
|
+
<!--
|
|
113
|
+
Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
|
|
114
|
+
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
115
|
+
--></a>
|
|
116
|
+
<a href="https://twitter.com/newsdict" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg>
|
|
117
|
+
<!--
|
|
118
|
+
Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
|
|
119
|
+
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
120
|
+
--></a>
|
|
121
|
+
</div><!-- .social-links -->
|
|
122
|
+
</div><!-- .site-nav-inside -->
|
|
123
|
+
</div><!-- .site-nav-wrap -->
|
|
124
|
+
</nav><!-- .site-navigation -->
|
|
125
|
+
|
|
126
|
+
</div><!-- .site-header-inside -->
|
|
127
|
+
</div><!-- .site-header-wrap -->
|
|
128
|
+
</header><!-- .site-header -->
|
|
129
|
+
<div id="content" class="site-content">
|
|
130
|
+
<div class="inner-wide">
|
|
131
|
+
|
|
132
|
+
<main id="main" class="site-main">
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<article class="post tag-rubygems post-full inner">
|
|
136
|
+
|
|
137
|
+
<header class="post-header">
|
|
138
|
+
<div class="post-meta">
|
|
139
|
+
<time class="published" datetime="2019-03-20">March 20, 2019</time>
|
|
140
|
+
</div><!-- .post-meta -->
|
|
141
|
+
<h1 class="post-title">gem作成でついまずいたところ</h1>
|
|
142
|
+
<div class="post-tags"><a href="/tag/rubygems/">rubygems</a></div>
|
|
143
|
+
</header><!-- .post-header -->
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<div class="post-content">
|
|
147
|
+
<p>・gitにcommit してないものは、gem build *.gemspec, rake buildをやってもrequire_pathsに書いたディレクトリはビルド対象にならない。</p>
|
|
148
|
+
</div><!-- .post-content -->
|
|
149
|
+
|
|
150
|
+
<footer class="post-footer">
|
|
151
|
+
<p class="post-share">
|
|
152
|
+
<span class="post-share-title">Share:</span>
|
|
153
|
+
<a target="_blank" href="https://twitter.com/intent/tweet?text=gem%E4%BD%9C%E6%88%90%E3%81%A7%E3%81%A4%E3%81%84%E3%81%BE%E3%81%9A%E3%81%84%E3%81%9F%E3%81%A8%E3%81%93%E3%82%8D&url=https://newsdict.blog/gem-issues/" rel="noopener">Twitter</a>
|
|
154
|
+
<a target="_blank" href="https://www.facebook.com/sharer.php?u=https://newsdict.blog/gem-issues/" rel="noopener">Facebook</a>
|
|
155
|
+
<a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=https://newsdict.blog/gem-issues/&title=gem%E4%BD%9C%E6%88%90%E3%81%A7%E3%81%A4%E3%81%84%E3%81%BE%E3%81%9A%E3%81%84%E3%81%9F%E3%81%A8%E3%81%93%E3%82%8D&source=newsdict.blog" rel="noopener">LinkedIn</a>
|
|
156
|
+
</p>
|
|
157
|
+
</footer><!-- .post-footer -->
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
</article><!-- .post -->
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<section class="tagcloud inner">
|
|
165
|
+
<h2 class="tagcloud-title">Tags</h2>
|
|
166
|
+
<div class="tag-links">
|
|
167
|
+
<a href="/tag/getting-started/">Getting Started (1)</a>
|
|
168
|
+
<a href="/tag/rubygems/">rubygems (1)</a>
|
|
169
|
+
</div><!-- .tag-links -->
|
|
170
|
+
</section><!-- .tagcloud -->
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
</main><!-- .site-main -->
|
|
174
|
+
|
|
175
|
+
<footer id="colophon" class="site-footer">
|
|
176
|
+
<p class="site-info inner"><a href="https://newsdict.blog">newsdict.blog</a> © 2019. Royce theme by <a target="_blank" href="https://justgoodthemes.com/" rel="noopener">Just Good Themes</a>. Powered by <a target="_blank" href="https://ghost.org" rel="noopener">Ghost</a>.</p>
|
|
177
|
+
<a id="back-to-top" class="back-to-top" href="#page"><span class="icon-arrow-up" aria-hidden="true"></span><span class="screen-reader-text">Back to top</span></a>
|
|
178
|
+
</footer><!-- .site-footer -->
|
|
179
|
+
</div><!-- .inner-wide -->
|
|
180
|
+
</div><!-- .site-content -->
|
|
181
|
+
</div><!-- .site -->
|
|
182
|
+
|
|
183
|
+
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
|
184
|
+
<script>window.jQuery || document.write('<script src="/assets/js/jquery-3.3.1.min.js?v=94e094a36d"><\/script>');</script>
|
|
185
|
+
<script src="/assets/js/plugins.js?v=94e094a36d"></script>
|
|
186
|
+
<script src="/assets/js/custom.js?v=94e094a36d"></script>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
</body>
|
|
191
|
+
</html>
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'rspec/expectations'
|
|
2
|
+
require "bundler/setup"
|
|
3
|
+
require "web_stat"
|
|
4
|
+
|
|
5
|
+
RSpec.configure do |config|
|
|
6
|
+
# Enable flags like --only-failures and --next-failure
|
|
7
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
|
8
|
+
|
|
9
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
|
10
|
+
config.disable_monkey_patching!
|
|
11
|
+
|
|
12
|
+
config.expect_with :rspec do |c|
|
|
13
|
+
c.syntax = :expect
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
RSpec::Matchers.define :be_string_or_nil do |expected|
|
|
17
|
+
match do |actual|
|
|
18
|
+
actual.nil? || actual.is_a?(String)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
RSpec::Matchers.define :be_tmp_file_or_nil do |expected|
|
|
22
|
+
match do |actual|
|
|
23
|
+
(actual.is_a?(String) && actual.match(/^\/tmp/)) || actual.nil?
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
RSpec::Matchers.define :be_array_or_nil do |expected|
|
|
27
|
+
match do |actual|
|
|
28
|
+
actual.nil? || actual.is_a?(Array)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
module WebStatTestHelper
|
|
33
|
+
class << self
|
|
34
|
+
# Get htmls of fixture
|
|
35
|
+
def htmls
|
|
36
|
+
Dir.glob(File.join(File.dirname(__FILE__), "fixtures", "htmls", "*.html")).map do |file|
|
|
37
|
+
File.open(file).read
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Get html of fixture by name
|
|
42
|
+
def html(name)
|
|
43
|
+
File.open(File.join(File.dirname(__FILE__), "fixtures", "htmls", "#{name}")).read
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Get htmls of fixture
|
|
47
|
+
def scheme_and_files
|
|
48
|
+
Dir.glob(File.join(File.dirname(__FILE__), "fixtures", "htmls", "*.html")).map do |file|
|
|
49
|
+
"file://#{file}"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
RSpec.describe WebStat::Configure do
|
|
2
|
+
it "Get Config by Singleton" do
|
|
3
|
+
configure = WebStat::Configure.get
|
|
4
|
+
expect(configure).not_to eq nil
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
it "Readable Config" do
|
|
8
|
+
config = WebStat::Configure.get
|
|
9
|
+
|
|
10
|
+
expect(config["min_length_of_meta_title"]).to eq 10
|
|
11
|
+
expect(config["regex_to_sprit_title"]).to eq '\||-|:|||:|〜|\~| – '
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
RSpec.describe WebStat::Fetch do
|
|
2
|
+
[{ fixture: WebStatTestHelper.htmls, class: WebStat::FetchAsHtml},
|
|
3
|
+
{ fixture: WebStatTestHelper.scheme_and_files, class: WebStat::FetchAsWeb}].each do |fetch|
|
|
4
|
+
|
|
5
|
+
it "Get title by #{fetch[:class].to_s}" do
|
|
6
|
+
fetch[:fixture].each do |fixture|
|
|
7
|
+
web_stat = fetch[:class].new(fixture)
|
|
8
|
+
expect(web_stat.title).to eq "gem作成でついまずいたところ"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "Get site name by #{fetch[:class].to_s}" do
|
|
13
|
+
fetch[:fixture].each do |fixture|
|
|
14
|
+
web_stat = fetch[:class].new(fixture)
|
|
15
|
+
expect(web_stat.site_name).to eq "newsdict.blog"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "Get Document's content by #{fetch[:class].to_s}" do
|
|
20
|
+
fetch[:fixture].each do |fixture|
|
|
21
|
+
web_stat = fetch[:class].new(fixture)
|
|
22
|
+
expect(web_stat.content).not_to eq nil
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "WebStat content do not include html by #{fetch[:class].to_s}" do
|
|
27
|
+
fetch[:fixture].each do |fixture|
|
|
28
|
+
web_stat = fetch[:class].new(fixture)
|
|
29
|
+
expect(Sanitize.clean(web_stat.content).length).to eq web_stat.content.length
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "Get eyecatch image path by #{fetch[:class].to_s}" do
|
|
34
|
+
fetch[:fixture].each do |fixture|
|
|
35
|
+
web_stat = fetch[:class].new(fixture)
|
|
36
|
+
expect(web_stat.eyecatch_image_path).to be_string_or_nil
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it "Get local path of eyecatch image by #{fetch[:class].to_s}" do
|
|
41
|
+
fetch[:fixture].each do |fixture|
|
|
42
|
+
web_stat = fetch[:class].new(fixture)
|
|
43
|
+
expect(web_stat.stat[:eyecatch_image_path]).to be_tmp_file_or_nil
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "WebStat.stat_by_html" do
|
|
49
|
+
WebStatTestHelper.htmls.each do |fixture|
|
|
50
|
+
web_stat = WebStat.stat_by_html(fixture)
|
|
51
|
+
expect(web_stat[:title]).to eq "gem作成でついまずいたところ"
|
|
52
|
+
expect(web_stat[:site_name]).to eq "newsdict.blog"
|
|
53
|
+
expect(web_stat[:content]).not_to eq nil
|
|
54
|
+
expect(Sanitize.clean(web_stat[:content]).length).to eq web_stat[:content].length
|
|
55
|
+
expect(web_stat[:eyecatch_image_path]).to be_tmp_file_or_nil
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it "WebStat.stat_by_url" do
|
|
60
|
+
WebStatTestHelper.scheme_and_files.each do |fixture|
|
|
61
|
+
web_stat = WebStat.stat_by_url(fixture)
|
|
62
|
+
expect(web_stat[:title]).to eq "gem作成でついまずいたところ"
|
|
63
|
+
expect(web_stat[:site_name]).to eq "newsdict.blog"
|
|
64
|
+
expect(web_stat[:content]).not_to eq nil
|
|
65
|
+
expect(Sanitize.clean(web_stat[:content]).length).to eq web_stat[:content].length
|
|
66
|
+
expect(web_stat[:eyecatch_image_path]).to be_tmp_file_or_nil
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
RSpec.describe WebStat::Tag do
|
|
2
|
+
[{ fixture: WebStatTestHelper.htmls, class: WebStat::FetchAsHtml},
|
|
3
|
+
{ fixture: WebStatTestHelper.scheme_and_files, class: WebStat::FetchAsWeb}].each do |fetch|
|
|
4
|
+
|
|
5
|
+
it "Morphological element analysis" do
|
|
6
|
+
fetch[:fixture].each do |fixture|
|
|
7
|
+
web_stat = fetch[:class].new(fixture)
|
|
8
|
+
tag = WebStat::Tag.new(web_stat.content)
|
|
9
|
+
expect(tag.nouns).to be_array_or_nil
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
end
|
data/web_stat.gemspec
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "web_stat/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "web_stat"
|
|
8
|
+
spec.version = WebStat::VERSION
|
|
9
|
+
spec.authors = ["yusuke abe"]
|
|
10
|
+
spec.email = ["yube@newsdict.jp"]
|
|
11
|
+
spec.summary = "Get the status of the web pages."
|
|
12
|
+
spec.description = <<-EOS.strip.gsub(/\s+/, ' ')
|
|
13
|
+
Fetch the web pages and stat.
|
|
14
|
+
EOS
|
|
15
|
+
spec.homepage = 'https://newsdict.blog/web-stat/'
|
|
16
|
+
spec.license = "MIT"
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
18
|
+
spec.bindir = "bin"
|
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
21
|
+
spec.require_paths = ["lib"]
|
|
22
|
+
|
|
23
|
+
spec.add_runtime_dependency "bundler", "~> 2.0"
|
|
24
|
+
spec.add_runtime_dependency "nokogiri", "~> 1.10"
|
|
25
|
+
spec.add_runtime_dependency "mechanize", "~> 2.7"
|
|
26
|
+
spec.add_runtime_dependency "ruby-readability", "~> 0.7"
|
|
27
|
+
spec.add_runtime_dependency "final_redirect_url", "~> 0.1.0"
|
|
28
|
+
spec.add_runtime_dependency "natto", "~> 1.1.2"
|
|
29
|
+
spec.add_runtime_dependency "sanitize", "~> 5.0.0"
|
|
30
|
+
|
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
33
|
+
end
|