artemo 3.0.7 → 3.0.8

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
  SHA1:
3
- metadata.gz: 98b47d1fc8b10049b62ed3775098df1e855a7158
4
- data.tar.gz: 10728772804729d046cec351cb565383205ea48a
3
+ metadata.gz: e93ea6b32c2cf82270bb8552366d257f471f1ced
4
+ data.tar.gz: 12d7c7a0042ed32161eb7ca619ac1ea6e53ea37b
5
5
  SHA512:
6
- metadata.gz: 9b5e07fa02ec93931bd808402ae7fc42f48ef79488798b586318abd85bcaaf662fac1d2930cbb2cef01baf353c0daeb3a59173a1ae5668bd1bdd1669c9ffe3de
7
- data.tar.gz: c32d513864f6857fdaccf3796e377ff31ff14259b1634e463ff399d0f9802e611ee8f96e17ee7f9536789a50d2ce016b82026ece2ea77211623e237bc9d16089
6
+ metadata.gz: 0f1de395200a55c6dff2da39a024a02bd27407918410499eea576fd7aea3f8b7c0b9c1a869ee729ec83a31b4d9a8e3a239df9015dab4824843f25e43ded3d023
7
+ data.tar.gz: cc147d27a3c5f50af89359e754170d534346f8bfe58977fe95fd26fc85c99bd784df6825c19d56e4f5f82ca41ab2a934b424a756b6262ba9d4ec49979bed6bb1
data/.DS_Store CHANGED
Binary file
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ pkg/*
3
3
  *.gem
4
4
  .bundle
5
5
  .yardoc
6
+ doc
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ Version 1.0
2
+ * Prototype of program
3
+ Version 2.x.x
4
+ * Tests of program
1
5
  Version 3.0.0
2
6
  * Rewritten, simpler and working.
3
7
  Version 3.0.1
@@ -13,4 +17,6 @@ Version 3.0.5
13
17
  Version 3.0.6
14
18
  * Gem homepage.
15
19
  Version 3.0.7
16
- * Small changes in display results.
20
+ * Small changes in display results.
21
+ Version 3.0.8
22
+ * Better gem description.
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM ruby:2.3.1
2
+
3
+ MAINTAINER Łukasz Fuszara
4
+
5
+ RUN mkdir /artemo
6
+ WORKDIR /artemo
7
+
8
+ RUN git clone https://gitlab.com/opalizoid/ArtEmo_v3.git
9
+ WORKDIR /artemo/ArtEmo_v3
10
+
11
+ RUN gem build artemo.gemspec
12
+ RUN gem install artemo-*
13
+ RUN echo "Wherefore, O judges, be of good cheer about death, and know of a certainty, that no evil can happen to a good man, either in life or after death. He and his are not neglected by the gods; nor has my own approaching end happened by mere chance. But I see clearly that the time had arrived when it was better for me to die and be released from trouble; wherefore the oracle gave no sign. For which reason, also, I am not angry with my condemners, or with my accusers; they have done me no harm, although they did not mean to do me any good; and for this I may gently blame them." > test.txt
14
+
15
+ ENTRYPOINT ["artemo", "test.txt"]
16
+
17
+ CMD ["bash"]
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artemo (3.0.5)
4
+ artemo (3.0.8)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -28,6 +28,7 @@ PLATFORMS
28
28
 
29
29
  DEPENDENCIES
30
30
  artemo!
31
+ bundler (~> 1.13)
31
32
  rake (~> 11.3)
32
33
  rspec (~> 3.5)
33
34
  yard (~> 0.9.5)
data/README.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Install gem https://rubygems.org/gems/artemo and use by: `artemo [your file]`.
4
4
 
5
+ Version 1.0
6
+
7
+ * Prototype of program
8
+
9
+ Version 2.x.x
10
+
11
+ * Tests of program
12
+
5
13
  Version 3.0.0
6
14
 
7
15
  * Rewritten, simpler and working.
@@ -32,4 +40,8 @@ Version 3.0.6
32
40
 
33
41
  Version 3.0.7
34
42
 
35
- * Small changes in display results.
43
+ * Small changes in display results.
44
+
45
+ Version 3.0.8
46
+
47
+ * Better gem description.
data/artemo.gemspec CHANGED
@@ -5,7 +5,10 @@ Gem::Specification.new do |s|
5
5
  s.version = ArtEmo::VERSION
6
6
  s.licenses = ['GPL-3.0']
7
7
  s.summary = "Analyze emotions in texts"
8
- s.description = "Simple program to analyze emotions in texts by keywords database. To use: artemo [path to file]"
8
+ s.description = <<-DESCRIPTION
9
+ Simple program to analyze emotions in texts by keywords database.
10
+ Use by: artemo [your file]
11
+ DESCRIPTION
9
12
  s.author = ["Łukasz Fuszara"]
10
13
  s.email = 'opalizoid@gmail.com'
11
14
  s.date = '2016-11-11'
@@ -13,10 +16,12 @@ Gem::Specification.new do |s|
13
16
  s.required_ruby_version = '>= 2.3.1'
14
17
 
15
18
  s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
16
20
  s.executable = 'artemo'
17
- s.require_path = 'lib'
21
+ s.require_path = ['lib', 'include']
18
22
 
19
23
  s.add_development_dependency 'rake', '~> 11.3'
20
24
  s.add_development_dependency 'rspec', '~> 3.5'
21
25
  s.add_development_dependency 'yard', '~> 0.9.5'
26
+ s.add_development_dependency "bundler", "~> 1.13"
22
27
  end
data/bin/artemo CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/local/bin/env ruby
2
2
 
3
3
  require 'artemo'
4
4
  puts ArtEmo.call(ARGV[0])
data/include/.DS_Store CHANGED
Binary file
@@ -1,3 +1,3 @@
1
1
  module ArtEmo
2
- VERSION = "3.0.7"
2
+ VERSION = "3.0.8"
3
3
  end
data/lib/artemo.rb CHANGED
@@ -23,4 +23,8 @@ class ArtEmo
23
23
  end
24
24
  end
25
25
 
26
- ARGV.first.nil? ? ArtEmo.call('include/text.txt') : ArtEmo.call(ARGV.first)
26
+ if ARGV.first.nil?
27
+ puts "artemo [your text file]"
28
+ else
29
+ ArtEmo.call(ARGV.first)
30
+ end
data/spec/.DS_Store CHANGED
Binary file
@@ -1,15 +1,62 @@
1
+ require 'tempfile'
2
+
1
3
  require 'artemo'
2
4
 
5
+ str = %q{
6
+ "Zarathustra" is my brother's most personal work; it is the history of
7
+ his most individual experiences, of his friendships, ideals, raptures,
8
+ bitterest disappointments and sorrows. Above it all, however, there
9
+ soars, transfiguring it, the image of his greatest hopes and remotest
10
+ aims. My brother had the figure of Zarathustra in his mind from his very
11
+ earliest youth: he once told me that even as a child he had dreamt of
12
+ him. At different periods in his life, he would call this haunter of his
13
+ dreams by different names; "but in the end," he declares in a note on
14
+ the subject, "I had to do a PERSIAN the honour of identifying him with
15
+ this creature of my fancy. Persians were the first to take a broad and
16
+ comprehensive view of history. Every series of evolutions, according
17
+ to them, was presided over by a prophet; and every prophet had his
18
+ 'Hazar,'--his dynasty of a thousand years."
19
+
20
+ All Zarathustra's views, as also his personality, were early conceptions
21
+ of my brother's mind. Whoever reads his posthumously published writings
22
+ for the years 1869-82 with care, will constantly meet with passages
23
+ suggestive of Zarathustra's thoughts and doctrines. For instance, the
24
+ ideal of the Superman is put forth quite clearly in all his writings
25
+ during the years 1873-75; and in "We Philologists", the following
26
+ remarkable observations occur:--
27
+
28
+ "How can one praise and glorify a nation as a whole?--Even among the
29
+ Greeks, it was the INDIVIDUALS that counted."
30
+
31
+ "The Greeks are interesting and extremely important because they reared
32
+ such a vast number of great individuals. How was this possible? The
33
+ question is one which ought to be studied.
34
+
35
+ "I am interested only in the relations of a people to the rearing of
36
+ the individual man, and among the Greeks the conditions were unusually
37
+ favourable for the development of the individual; not by any means owing
38
+ to the goodness of the people, but because of the struggles of their
39
+ evil instincts.
40
+ }
41
+
3
42
  describe Loader do
4
43
  context 'Created words from text' do
5
44
  it 'should class be Array' do
6
- k = Loader.call('include/text.txt')
7
- expect(k).to be_instance_of Array
45
+ Tempfile.open("test.txt") do |f|
46
+ f.write(str)
47
+ f.close
48
+ k = Loader.call(f)
49
+ expect(k).to be_instance_of Array
50
+ end
8
51
  end
9
52
 
10
53
  it 'should class be Array' do
11
- k = Loader.call('include/text.txt')
12
- expect(k).to be_instance_of Array
54
+ Tempfile.open("test.txt") do |f|
55
+ f.write(str)
56
+ f.close
57
+ k = Loader.call(f)
58
+ expect(k).to be_instance_of Array
59
+ end
13
60
  end
14
61
  end
15
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artemo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Łukasz Fuszara
@@ -52,8 +52,22 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.5
55
- description: 'Simple program to analyze emotions in texts by keywords database. To
56
- use: artemo [path to file]'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.13'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.13'
69
+ description: " Simple program to analyze emotions in texts by keywords database.
70
+ \n Use by: artemo [your file]\n"
57
71
  email: opalizoid@gmail.com
58
72
  executables:
59
73
  - artemo
@@ -65,6 +79,7 @@ files:
65
79
  - ".gitlab-ci.yml"
66
80
  - CHANGELOG
67
81
  - CONTRIBUTING.md
82
+ - Dockerfile
68
83
  - Gemfile
69
84
  - Gemfile.lock
70
85
  - LICENSE
@@ -74,7 +89,6 @@ files:
74
89
  - bin/artemo
75
90
  - include/.DS_Store
76
91
  - include/database.yaml
77
- - include/text.txt
78
92
  - lib/.DS_Store
79
93
  - lib/artemo.rb
80
94
  - lib/artemo/.DS_Store
@@ -98,6 +112,7 @@ post_install_message:
98
112
  rdoc_options: []
99
113
  require_paths:
100
114
  - lib
115
+ - include
101
116
  required_ruby_version: !ruby/object:Gem::Requirement
102
117
  requirements:
103
118
  - - ">="
data/include/text.txt DELETED
@@ -1,25 +0,0 @@
1
- There are many reasons why I am not grieved, O men of Athens, at the vote of condemnation. I expected it, and am only surprised that the votes are so nearly equal; for I had thought that the majority against me would have been far larger; but now, had thirty votes gone over to the other side, I should have been acquitted. And I may say, I think, that I have escaped Meletus. I may say more; for without the assistance of Anytus and Lycon, any one may see that he would not have had a fifth part of the votes, as the law requires, in which case he would have incurred a fine of a thousand drachmae.
2
-
3
- And so he proposes death as the penalty. And what shall I propose on my part, O men of Athens? Clearly that which is my due. And what is my due? What return shall be made to the man who has never had the wit to be idle during his whole life; but has been careless of what the many care for—wealth, and family interests, and military offices, and speaking in the assembly, and magistracies, and plots, and parties. Reflecting that I was really too honest a man to be a politician and live, I did not go where I could do no good to you or to myself; but where I could do the greatest good privately to every one of you, thither I went, and sought to persuade every man among you that he must look to himself, and seek virtue and wisdom before he looks to his private interests, and look to the state before he looks to the interests of the state; and that this should be the order which he observes in all his actions. What shall be done to such an one? Doubtless some good thing, O men of Athens, if he has his reward; and the good should be of a kind suitable to him. What would be a reward suitable to a poor man who is your benefactor, and who desires leisure that he may instruct you? There can be no reward so fitting as maintenance in the Prytaneum, O men of Athens, a reward which he deserves far more than the citizen who has won the prize at Olympia in the horse or chariot race, whether the chariots were drawn by two horses or by many. For I am in want, and he has enough; and he only gives you the appearance of happiness, and I give you the reality. And if I am to estimate the penalty fairly, I should say that maintenance in the Prytaneum is the just return.
4
-
5
- Perhaps you think that I am braving you in what I am saying now, as in what I said before about the tears and prayers. But this is not so. I speak rather because I am convinced that I never intentionally wronged any one, although I cannot convince you—the time has been too short; if there were a law at Athens, as there is in other cities, that a capital cause should not be decided in one day, then I believe that I should have convinced you. But I cannot in a moment refute great slanders; and, as I am convinced that I never wronged another, I will assuredly not wrong myself. I will not say of myself that I deserve any evil, or propose any penalty. Why should I? because I am afraid of the penalty of death which Meletus proposes? When I do not know whether death is a good or an evil, why should I propose a penalty which would certainly be an evil? Shall I say imprisonment? And why should I live in prison, and be the slave of the magistrates of the year—of the Eleven? Or shall the penalty be a fine, and imprisonment until the fine is paid? There is the same objection. I should have to lie in prison, for money I have none, and cannot pay. And if I say exile (and this may possibly be the penalty which you will affix), I must indeed be blinded by the love of life, if I am so irrational as to expect that when you, who are my own citizens, cannot endure my discourses and words, and have found them so grievous and odious that you will have no more of them, others are likely to endure me. No indeed, men of Athens, that is not very likely. And what a life should I lead, at my age, wandering from city to city, ever changing my place of exile, and always being driven out! For I am quite sure that wherever I go, there, as here, the young men will flock to me; and if I drive them away, their elders will drive me out at their request; and if I let them come, their fathers and friends will drive me out for their sakes.
6
-
7
- Some one will say: Yes, Socrates, but cannot you hold your tongue, and then you may go into a foreign city, and no one will interfere with you? Now I have great difficulty in making you understand my answer to this. For if I tell you that to do as you say would be a disobedience to the God, and therefore that I cannot hold my tongue, you will not believe that I am serious; and if I say again that daily to discourse about virtue, and of those other things about which you hear me examining myself and others, is the greatest good of man, and that the unexamined life is not worth living, you are still less likely to believe me. Yet I say what is true, although a thing of which it is hard for me to persuade you. Also, I have never been accustomed to think that I deserve to suffer any harm. Had I money I might have estimated the offence at what I was able to pay, and not have been much the worse. But I have none, and therefore I must ask you to proportion the fine to my means. Well, perhaps I could afford a mina, and therefore I propose that penalty: Plato, Crito, Critobulus, and Apollodorus, my friends here, bid me say thirty minae, and they will be the sureties. Let thirty minae be the penalty; for which sum they will be ample security to you.
8
-
9
- Not much time will be gained, O Athenians, in return for the evil name which you will get from the detractors of the city, who will say that you killed Socrates, a wise man; for they will call me wise, even although I am not wise, when they want to reproach you. If you had waited a little while, your desire would have been fulfilled in the course of nature. For I am far advanced in years, as you may perceive, and not far from death. I am speaking now not to all of you, but only to those who have condemned me to death. And I have another thing to say to them: you think that I was convicted because I had no words of the sort which would have procured my acquittal—I mean, if I had thought fit to leave nothing undone or unsaid. Not so; the deficiency which led to my conviction was not of words—certainly not. But I had not the boldness or impudence or inclination to address you as you would have liked me to do, weeping and wailing and lamenting, and saying and doing many things which you have been accustomed to hear from others, and which, as I maintain, are unworthy of me. I thought at the time that I ought not to do anything common or mean when in danger: nor do I now repent of the style of my defence; I would rather die having spoken after my manner, than speak in your manner and live. For neither in war nor yet at law ought I or any man to use every way of escaping death. Often in battle there can be no doubt that if a man will throw away his arms, and fall on his knees before his pursuers, he may escape death; and in other dangers there are other ways of escaping death, if a man is willing to say and do anything.
10
-
11
- The difficulty, my friends, is not to avoid death, but to avoid unrighteousness; for that runs faster than death. I am old and move slowly, and the slower runner has overtaken me, and my accusers are keen and quick, and the faster runner, who is unrighteousness, has overtaken them. And now I depart hence condemned by you to suffer the penalty of death,—they too go their ways condemned by the truth to suffer the penalty of villainy and wrong; and I must abide by my award—let them abide by theirs. I suppose that these things may be regarded as fated,—and I think that they are well.
12
-
13
- And now, O men who have condemned me, I would fain prophesy to you; for I am about to die, and in the hour of death men are gifted with prophetic power. And I prophesy to you who are my murderers, that immediately after my departure punishment far heavier than you have inflicted on me will surely await you. Me you have killed because you wanted to escape the accuser, and not to give an account of your lives. But that will not be as you suppose: far otherwise. For I say that there will be more accusers of you than there are now; accusers whom hitherto I have restrained: and as they are younger they will be more inconsiderate with you, and you will be more offended at them. If you think that by killing men you can prevent some one from censuring your evil lives, you are mistaken; that is not a way of escape which is either possible or honourable; the easiest and the noblest way is not to be disabling others, but to be improving yourselves. This is the prophecy which I utter before my departure to the judges who have condemned me.
14
-
15
- Friends, who would have acquitted me, I would like also to talk with you about the thing which has come to pass, while the magistrates are busy, and before I go to the place at which I must die. Stay then a little, for we may as well talk with one another while there is time. You are my friends, and I should like to show you the meaning of this event which has happened to me. O my judges—for you I may truly call judges—I should like to tell you of a wonderful circumstance. Hitherto the divine faculty of which the internal oracle is the source has constantly been in the habit of opposing me even about trifles, if I was going to make a slip or error in any matter; and now as you see there has come upon me that which may be thought, and is generally believed to be, the last and worst evil. But the oracle made no sign of opposition, either when I was leaving my house in the morning, or when I was on my way to the court, or while I was speaking, at anything which I was going to say; and yet I have often been stopped in the middle of a speech, but now in nothing I either said or did touching the matter in hand has the oracle opposed me. What do I take to be the explanation of this silence? I will tell you. It is an intimation that what has happened to me is a good, and that those of us who think that death is an evil are in error. For the customary sign would surely have opposed me had I been going to evil and not to good.
16
-
17
- Let us reflect in another way, and we shall see that there is great reason to hope that death is a good; for one of two things—either death is a state of nothingness and utter unconsciousness, or, as men say, there is a change and migration of the soul from this world to another. Now if you suppose that there is no consciousness, but a sleep like the sleep of him who is undisturbed even by dreams, death will be an unspeakable gain. For if a person were to select the night in which his sleep was undisturbed even by dreams, and were to compare with this the other days and nights of his life, and then were to tell us how many days and nights he had passed in the course of his life better and more pleasantly than this one, I think that any man, I will not say a private man, but even the great king will not find many such days or nights, when compared with the others. Now if death be of such a nature, I say that to die is gain; for eternity is then only a single night.
18
-
19
- But if death is the journey to another place, and there, as men say, all the dead abide, what good, O my friends and judges, can be greater than this? If indeed when the pilgrim arrives in the world below, he is delivered from the professors of justice in this world, and finds the true judges who are said to give judgment there, Minos and Rhadamanthus and Aeacus and Triptolemus, and other sons of God who were righteous in their own life, that pilgrimage will be worth making. What would not a man give if he might converse with Orpheus and Musaeus and Hesiod and Homer? Nay, if this be true, let me die again and again. I myself, too, shall have a wonderful interest in there meeting and conversing with Palamedes, and Ajax the son of Telamon, and any other ancient hero who has suffered death through an unjust judgment; and there will be no small pleasure, as I think, in comparing my own sufferings with theirs. Above all, I shall then be able to continue my search into true and false knowledge; as in this world, so also in the next; and I shall find out who is wise, and who pretends to be wise, and is not. What would not a man give, O judges, to be able to examine the leader of the great Trojan expedition; or Odysseus or Sisyphus, or numberless others, men and women too! What infinite delight would there be in conversing with them and asking them questions! In another world they do not put a man to death for asking questions: assuredly not. For besides being happier than we are, they will be immortal, if what is said is true.
20
-
21
- Wherefore, O judges, be of good cheer about death, and know of a certainty, that no evil can happen to a good man, either in life or after death. He and his are not neglected by the gods; nor has my own approaching end happened by mere chance. But I see clearly that the time had arrived when it was better for me to die and be released from trouble; wherefore the oracle gave no sign. For which reason, also, I am not angry with my condemners, or with my accusers; they have done me no harm, although they did not mean to do me any good; and for this I may gently blame them.
22
-
23
- Still I have a favour to ask of them. When my sons are grown up, I would ask you, O my friends, to punish them; and I would have you trouble them, as I have troubled you, if they seem to care about riches, or anything, more than about virtue; or if they pretend to be something when they are really nothing,—then reprove them, as I have reproved you, for not caring about that for which they ought to care, and thinking that they are something when they are really nothing. And if you do this, both I and my sons will have received justice at your hands.
24
-
25
- The hour of departure has arrived, and we go our ways—I to die, and you to live. Which is better God only knows.