Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Timecop to development dependencies #55

Closed
madejejej opened this issue Mar 29, 2017 · 3 comments
Closed

Push Timecop to development dependencies #55

madejejej opened this issue Mar 29, 2017 · 3 comments

Comments

@madejejej
Copy link

In the gemspec the Timecop gem is listed as a regular dependency:

  spec.add_dependency 'timecop', '>= 0.1.0'

You probably want to include it only as a development dependency since it's only being used in spec/knapsack/tracker_spec.rb:

https://github.com/ArturT/knapsack/search?utf8=%E2%9C%93&q=Timecop&type=

@ArturT
Copy link
Member

ArturT commented Mar 31, 2017

It is used here:
https://github.com/ArturT/knapsack/blob/master/lib/knapsack/tracker.rb#L84

def now_without_mock_time
  Time.now_without_mock_time
end

now_without_mock_time is Timecop method: https://github.com/travisjeffery/timecop/search?utf8=%E2%9C%93&q=now_without_mock_time&type=

Anyway thanks for checking :)

@ArturT ArturT closed this as completed Mar 31, 2017
@ArturT
Copy link
Member

ArturT commented May 12, 2017

Note to myself. It was done this way on purpose. Timecop is a regular dependency and I don't want to use Time.now because someone could stub Time.now and that would prevent to determine the correct time.

Here is related commit in knapsack_pro KnapsackPro/knapsack_pro-ruby@f6fe6a2/knapsack_pro.gemspec#diff-0

@ArturT ArturT changed the title Push Timecop to development dependencies Remove timecop gem from required dependencies list May 12, 2017
@ArturT ArturT changed the title Remove timecop gem from required dependencies list Push Timecop to development dependencies May 12, 2017
@ArturT
Copy link
Member

ArturT commented May 12, 2017

I figured out how Timecop gem could be moved to development dependencies. I did change in knapsack_pro KnapsackPro/knapsack_pro-ruby#38

A similar thing could be done here in knapsack gem. If anyone wants to help it's basically copy & paste from the PR

first-timers-only info

This could be an easy task for someone new who would like to contribute to open source.

Tips for first timers how to make pull request https://github.com/CPAN-PRC/resources/wiki/My-first-Pull-Request

@ArturT ArturT reopened this May 12, 2017
ArturT added a commit that referenced this issue May 28, 2017
Moves Timecop to development dependency, Issue #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants